From c245790ef1e6861d9dd17664c90ec0fc1186ea28 Mon Sep 17 00:00:00 2001
From: liudong <liudong>
Date: 星期五, 09 八月 2024 14:03:58 +0800
Subject: [PATCH] 菜单修改
---
src/router/guard/userLoginInfo.ts | 63 ++++++++++++++++---------------
1 files changed, 32 insertions(+), 31 deletions(-)
diff --git a/src/router/guard/userLoginInfo.ts b/src/router/guard/userLoginInfo.ts
index 7a06895..876976d 100644
--- a/src/router/guard/userLoginInfo.ts
+++ b/src/router/guard/userLoginInfo.ts
@@ -8,36 +8,37 @@
router.beforeEach(async (to, from, next) => {
NProgress.start();
const userStore = useUserStore();
- if (isLogin()) {
- if (userStore.role) {
- next();
- } else {
- try {
- await userStore.info();
- next();
- } catch (error) {
- await userStore.logout();
- next({
- name: 'login',
- query: {
- redirect: to.name,
- ...to.query,
- } as LocationQueryRaw,
- });
- }
- }
- } else {
- if (to.name === 'login') {
- next();
- return;
- }
- next({
- name: 'login',
- query: {
- redirect: to.name,
- ...to.query,
- } as LocationQueryRaw,
- });
- }
+ next();
+ // if (isLogin()) {
+ // if (userStore.role) {
+ // next();
+ // } else {
+ // try {
+ // await userStore.info();
+ // next();
+ // } catch (error) {
+ // await userStore.logout();
+ // next({
+ // name: 'login',
+ // query: {
+ // redirect: to.name,
+ // ...to.query,
+ // } as LocationQueryRaw,
+ // });
+ // }
+ // }
+ // } else {
+ // if (to.name === 'login') {
+ // next();
+ // return;
+ // }
+ // next({
+ // name: 'login',
+ // query: {
+ // redirect: to.name,
+ // ...to.query,
+ // } as LocationQueryRaw,
+ // });
+ // }
});
}
--
Gitblit v1.8.0