feat: 授权后token刷新保持

This commit is contained in:
duanshuwen
2025-11-18 19:40:28 +08:00
parent de272b1160
commit de412aed9c
9 changed files with 40 additions and 45 deletions

View File

@@ -11,7 +11,6 @@ import { NOTICE_EVENT_LOGIN_SUCCESS } from "@/constant/constant";
const loginAuth = (e) => {
uni.setStorageSync("token", "");
const appStore = useAppStore();
appStore.setHasToken(false);
return new Promise(async (resolve, reject) => {
const openIdCode = await getWeChatAuthCode(e);
@@ -28,8 +27,6 @@ const loginAuth = (e) => {
if (response.access_token) {
uni.setStorageSync("token", response.access_token);
const appStore = useAppStore();
appStore.setHasToken(true);
// 登录成功后,触发登录成功事件
uni.$emit(NOTICE_EVENT_LOGIN_SUCCESS);
resolve();