Merge pull request 'feat : 测试sso单点登录之后的重定向路径3' (#107) from master into prod

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/107
This commit is contained in:
clay
2024-04-29 03:28:30 +00:00
2 changed files with 89 additions and 86 deletions

View File

@@ -189,7 +189,8 @@ router.beforeEach(async (to, form, next) => {
NProgress.done() NProgress.done()
} else { } else {
sessionStorage.setItem('toView', JSON.stringify(to)) sessionStorage.setItem('toView', JSON.stringify(to))
next({path: '/api/auth/cas/login'}) window.location.href = `${window.location.origin}/api/auth/cas/login`
// next({path: '/api/auth/cas/login'})
} }
} else { } else {
if (to.path === '/login'|| to.path === '/cas/login') { if (to.path === '/login'|| to.path === '/cas/login') {

View File

@@ -29,6 +29,7 @@ serveice.interceptors.response.use(response=>{
if (response.request.responseType === 'blob' || response.request.responseType === 'arraybuffer') { if (response.request.responseType === 'blob' || response.request.responseType === 'arraybuffer') {
return response.data return response.data
} }
console.log("windows", window.location.pathname)
return response.data return response.data
}, error => { }, error => {
let response = error.response let response = error.response
@@ -42,6 +43,7 @@ serveice.interceptors.response.use(response=>{
closeOnClickModal: false closeOnClickModal: false
}).then(() => { }).then(() => {
removeToken() removeToken()
sessionStorage.setItem('toView', window.location.pathname)
window.location = '/api/auth/cas/login' window.location = '/api/auth/cas/login'
}) })
return Promise.reject('会话已过期,请重新登录') return Promise.reject('会话已过期,请重新登录')