From 1c83eedaf6fb58f448a1e51e54c8f3eeb6f0b6df Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 8 Feb 2023 11:12:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=99=BB=E5=BD=95):=20=E9=80=80=E5=87=BA?= =?UTF-8?q?=E5=90=8E=E9=87=8D=E6=96=B0=E7=99=BB=E5=BD=95=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E5=88=B0=E5=8E=86=E5=8F=B2=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/layout/components/Topbar.vue | 2 +- frontend/src/permission.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/src/layout/components/Topbar.vue b/frontend/src/layout/components/Topbar.vue index 0eca5b451d..29ce410ffb 100644 --- a/frontend/src/layout/components/Topbar.vue +++ b/frontend/src/layout/components/Topbar.vue @@ -365,7 +365,7 @@ export default { if (result !== 'success' && result !== 'fail') { window.location.href = result } else { - this.$router.push('/login') + this.$router.push(`/login?redirect=${this.$route.fullPath}`) } }, loadUiInfo() { diff --git a/frontend/src/permission.js b/frontend/src/permission.js index ba89f734a7..c5961184b6 100644 --- a/frontend/src/permission.js +++ b/frontend/src/permission.js @@ -53,7 +53,7 @@ const routeBefore = (callBack) => { callBack() } } -router.beforeEach(async(to, from, next) => routeBefore(() => { +router.beforeEach(async (to, from, next) => routeBefore(() => { // start progress bar NProgress.start() const mobileIgnores = ['/delink'] @@ -118,8 +118,7 @@ router.beforeEach(async(to, from, next) => routeBefore(() => { next() } else { // other pages that do not have permission to access are redirected to the login page. - // next(`/login?redirect=${to.path}`) - next('/login') + next(`/login?redirect=${to.path}`) NProgress.done() } }