mirror of
https://github.com/veops/cmdb.git
synced 2025-08-25 04:41:45 +08:00
feat(ui): record the page path when logout
This commit is contained in:
@@ -184,7 +184,16 @@ const user = {
|
||||
}).catch(() => {
|
||||
resolve()
|
||||
}).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()
|
||||
this.loading = false
|
||||
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) {
|
||||
this.time = 0
|
||||
|
Reference in New Issue
Block a user