微信授权登录功能开发联调

This commit is contained in:
冯辉
2025-10-20 11:43:44 +08:00
parent ae91ded327
commit d9c1f83693
5 changed files with 784 additions and 41 deletions

View File

@@ -64,17 +64,21 @@ const useUserStore = defineStore("user", () => {
});
}
const logOut = () => {
const logOut = (redirect = true) => {
hasLogin.value = false;
token.value = ''
resume.value = {}
userInfo.value = {}
role.value = {}
uni.clearStorageSync('userInfo')
uni.clearStorageSync('token')
uni.redirectTo({
url: '/pages/login/login',
});
uni.removeStorageSync('userInfo')
uni.removeStorageSync('token')
// 只有在明确需要跳转时才跳转到登录页
if (redirect) {
uni.redirectTo({
url: '/pages/login/login',
});
}
}
const getUserInfo = () => {