[update]-单点登录的调试
This commit is contained in:
+1
-1
@@ -65,7 +65,7 @@ export function logout(logoutToken) {
|
||||
*/
|
||||
export function thirdLogin(token) {
|
||||
return axios({
|
||||
url: `/sys/thirdLogin/getLoginUser/${token}`,
|
||||
url: `/company/getLoginUser/${token}`,
|
||||
method: 'get',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8'
|
||||
|
||||
+5
-6
@@ -51,22 +51,21 @@ router.beforeEach(async (to, from, next) => {
|
||||
const redirect = decodeURIComponent(from.query.redirect || to.path)
|
||||
if (to.path === redirect) {
|
||||
// hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
|
||||
// next({ ...to, replace: true })
|
||||
next({ ...to, replace: true })
|
||||
} else {
|
||||
// 跳转到目的路由
|
||||
// next({ path: redirect })
|
||||
next({ path: redirect })
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e, '%%%%%%%%%%')
|
||||
/* notification.error({
|
||||
message: '系统提示',
|
||||
description: '请求用户信息失败,请重试!'
|
||||
})*/
|
||||
// store.dispatch('Logout').then(() => {
|
||||
// next({ path: '/user/login', query: { redirect: to.fullPath } })
|
||||
// })
|
||||
store.dispatch('Logout').then(() => {
|
||||
next({ path: '/user/login', query: { redirect: to.fullPath } })
|
||||
})
|
||||
})
|
||||
} else {
|
||||
next()
|
||||
|
||||
Reference in New Issue
Block a user