feat: 登录拦截功能完善

This commit is contained in:
duanshuwen
2025-09-13 22:01:50 +08:00
parent 11141ae436
commit 261fb16bd6
11 changed files with 139 additions and 119 deletions

View File

@@ -4,6 +4,7 @@ import {
checkUserPhone,
} from "../request/api/LoginApi";
import { getWeChatAuthCode } from "./AuthManager";
import { useAppStore } from "@/store";
const loginAuth = () => {
return new Promise(async (resolve, reject) => {
@@ -20,6 +21,9 @@ const loginAuth = () => {
if (response.access_token) {
uni.setStorageSync("token", response.access_token);
const appStore = useAppStore();
appStore.setHasToken(true);
resolve();
} else {
reject(response.message || "登录失败");