From c76922f37ddeeb3344304af453dd2f8befdedb89 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Tue, 30 Sep 2025 14:18:00 +0800
Subject: [PATCH] feat: app搭建调整

---
 src/plugins/permission.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/plugins/permission.js b/src/plugins/permission.js
index 4e871c3..0700fc8 100644
--- a/src/plugins/permission.js
+++ b/src/plugins/permission.js
@@ -5,7 +5,7 @@
   removeQueryString,
   routes
 } from "@/router"
-import { isLogin } from "@/utils/auth"
+import {useUserStore} from "@/store/index.js";
 
 // 白名单路由
 const whiteList = ["/"]
@@ -28,7 +28,7 @@
     return false
   }
   // 在白名单中或有token,直接放行
-  const hasPermission = whiteList.includes(removeQueryString(path)) || isLogin()
+  const hasPermission = whiteList.includes(removeQueryString(path)) || useUserStore().$state.userInfo.access_token
   if (!hasPermission) {
     // 将用户的目标路径传递过去,这样可以实现用户登录之后,直接跳转到目标页面
     uni.redirectTo({

--
Gitblit v1.9.3