From b308f037bb6f1365c51b367ed4db5f8372febc90 Mon Sep 17 00:00:00 2001 From: liudong <liudong> Date: 星期五, 26 七月 2024 19:09:42 +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