From 2a8ff1a3da3ba1eeb0489b9888d2a082fc263f6e Mon Sep 17 00:00:00 2001 From: kubbo <390378816@qq.com> Date: Sat, 14 Jan 2023 23:00:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=96=8F=E9=80=9A=E8=B7=B3=E8=BD=AC=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/utils/router.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/utils/router.js b/web/src/utils/router.js index 5520639..8a4d67c 100644 --- a/web/src/utils/router.js +++ b/web/src/utils/router.js @@ -31,7 +31,9 @@ export default loadApps().then(() => createRouter({ //全局路由守卫 router.beforeEach((to, from, next) => { console.log('%s=>%s', from.name, to.name) - if (getToken()) { + if (to.name == "工作台") { + next() + } else if (getToken()) { next({name: "工作台"}) } else if (to.name != '登录') { next({name: "登录"})