问题描述
以下是用于Google身份验证的功能,但我希望在用户成功重定向到主页后保留这些值,以便能够显示用户的简历以个性化用户。但是,每次将页面重定向到首页或其他页面时,值往往会丢失。
如何使值在重新加载后仍保留?
function onSignIn(googleUser) {
const profile = googleUser.getBasicProfile();
console.log('ID: ' + profile.getId(),{ sameSite: 'none',secure: true });
console.log('Full Name: ' + profile.getName(),secure: true });
console.log('Image URL: ' + profile.getimageUrl(),secure: true });
console.log('Email: ' + profile.getEmail(),secure: true });
// Encrypted token passed to back end for security purpose:
const id_token = googleUser.getAuthResponse().id_token;
console.log('ID Token: ' + id_token);
window.location.href = '/home.html';
};
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)