From d0fd7f1798b6e417d78b72efaa95f912c35e6069 Mon Sep 17 00:00:00 2001 From: fengchenchen Date: Mon, 8 Apr 2024 15:31:47 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90update=E3=80=91=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=90=8E=E9=87=8D=E5=AE=9A=E5=90=91=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/permission.js b/src/permission.js index c4ed6a6b..facad05d 100644 --- a/src/permission.js +++ b/src/permission.js @@ -19,10 +19,9 @@ router.beforeEach(async (to, from, next) => { if (to.query.ticket) { const { result, success, message } = await getTodoSSOUserInfo({ ticket: to.query.ticket }) if (!success) { - Vue.prototype.$message.warning(message) - setTimeout(() => { - next('/') - }, 2000) + Vue.prototype.$message.warning(message, 3, () => { + window.location.replace(process.env.VUE_APP_LOGOUT_PAGE) + }) } else { const userInfo = result.userInfo Vue.ls.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000) @@ -38,10 +37,9 @@ router.beforeEach(async (to, from, next) => { // 研发大前台单点登录 const { result, success, message } = await getSSOUserInfo({ code: to.query.code }) if (!success) { - Vue.prototype.$message.warning(message) - setTimeout(() => { - next('/') - }, 2000) + Vue.prototype.$message.warning(message, 3, () => { + window.location.replace(process.env.VUE_APP_LOGOUT_PAGE) + }) } else { const userInfo = result.userInfo Vue.ls.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)