mirror of
https://github.com/veops/cmdb.git
synced 2025-08-25 20:09:00 +08:00
feat(ui): record the page path when logout
This commit is contained in:
@@ -184,7 +184,16 @@ const user = {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
resolve()
|
resolve()
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
window.location.href = '/user/logout'
|
let logoutURL = '/user/logout'
|
||||||
|
const fullPath = window.location.pathname + window.location.search
|
||||||
|
if (
|
||||||
|
fullPath &&
|
||||||
|
fullPath !== '/'
|
||||||
|
) {
|
||||||
|
logoutURL += `?redirect=${fullPath}`
|
||||||
|
}
|
||||||
|
|
||||||
|
window.location.href = logoutURL
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@@ -64,7 +64,13 @@ export default {
|
|||||||
await this.GetAuthDataEnable()
|
await this.GetAuthDataEnable()
|
||||||
this.loading = false
|
this.loading = false
|
||||||
if (!this._enable_list.length || this._enable_list.length > 1) {
|
if (!this._enable_list.length || this._enable_list.length > 1) {
|
||||||
this.$router.push('/user/login')
|
let loginURL = '/user/login'
|
||||||
|
const redirect = this.$route?.query?.redirect
|
||||||
|
if (redirect) {
|
||||||
|
loginURL += `?redirect=${redirect}`
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$router.push(loginURL)
|
||||||
}
|
}
|
||||||
if (this.auth_auto_redirect) {
|
if (this.auth_auto_redirect) {
|
||||||
this.time = 0
|
this.time = 0
|
||||||
|
Reference in New Issue
Block a user