登录后使用“使用google +帐户登录”重定向到主页:Javascript

时间:2014-05-16 05:55:16

标签: google-app-engine

我按照步骤创建了Google +按钮并验证了用户信息。但是,在使用我的Google +帐户成功登录后,我不知道如何重定向到我的主页。任何提示都会有所帮助!

1 个答案:

答案 0 :(得分:0)

我们可以在signinCallback()中指定要重定向的页面。 例如:

  function signinCallback(authResult) {
   if (authResult['access_token']) {
    // The user is signed in
    var loc = 'index.jsp?GoogleAuthToken=' + authResult['access_token'];
    window.location.href = loc;
    } else if (authResult['error']) {
    // There was an error, which means the user is not signed in.
     return false;
    }
}

这是用于重定向到索引页面。

相关问题