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)