[update]-单点登录的调试

This commit is contained in:
fengchenchen
2021-12-24 16:16:21 +08:00
parent 0905fa3202
commit 1ff6851168
2 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -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
View File
@@ -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()