From 6aa1bcf2b2ebd6c709cd60a05fb6dc4534c0762c Mon Sep 17 00:00:00 2001
From: yinbangzhong <zhongbangyin@126.com>
Date: 星期三, 07 八月 2024 13:34:36 +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