我按照步骤创建了Google +按钮并验证了用户信息。但是,在使用我的Google +帐户成功登录后,我不知道如何重定向到我的主页。任何提示都会有所帮助!
答案 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;
}
}
这是用于重定向到索引页面。