【update】登录失败后重定向地址的修改

This commit is contained in:
fengchenchen
2024-04-08 15:31:47 +08:00
parent 498b0ee233
commit d0fd7f1798
+6 -8
View File
@@ -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)