【update】登录失败后重定向地址的修改
This commit is contained in:
+6
-8
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user