feat : 测试sso单点登录之后的重定向路径4

This commit is contained in:
clay
2024-04-29 11:49:46 +08:00
parent 929228974a
commit 2bb86ced15
4 changed files with 246 additions and 225 deletions

View File

@@ -29,7 +29,8 @@ serveice.interceptors.response.use(response => {
if (response.request.responseType === 'blob' || response.request.responseType === 'arraybuffer') {
return response.data
}
console.log("windows", window.location.pathname)
console.log("window.location.pathname", window.location.pathname)
console.log("windows", window.location.search)
return response.data
}, error => {
let response = error.response
@@ -43,8 +44,13 @@ serveice.interceptors.response.use(response => {
closeOnClickModal: false
}).then(() => {
removeToken()
sessionStorage.setItem('toView', window.location.pathname)
window.location = '/api/auth/cas/login'
let path = window.location.pathname;
let query = window.location.search
sessionStorage.setItem('toView', JSON.stringify({
path: path,
query: query
}))
window.location.href = `${window.location.origin}/api/auth/cas/login`
})
return Promise.reject('会话已过期,请重新登录')
case 402: