fix: 修复token登录验证问题

This commit is contained in:
sunxiaolong
2024-01-08 00:42:56 +08:00
parent b53fcc83bf
commit 678d3ce15c

View File

@@ -8,7 +8,7 @@ export default function setupUserLoginInfoGuard(router: Router) {
router.beforeEach(async (to, from, next) => {
NProgress.start();
const userStore = useUserStore();
if (isLogin()) {
if (isLogin() && to.meta?.requiresAuth) {
if (userStore.role) {
next();
} else {