mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-22 08:36:42 +00:00
perf: 修改 token
This commit is contained in:
parent
0b5820edba
commit
ee901e54d3
@ -22,7 +22,7 @@ async function checkLogin({ to, from, next }) {
|
|||||||
}
|
}
|
||||||
// Determine whether the user has logged in
|
// Determine whether the user has logged in
|
||||||
const hasToken = getTokenFromCookie()
|
const hasToken = getTokenFromCookie()
|
||||||
if (!hasToken) {
|
if (!hasToken || hasToken === 'null') {
|
||||||
request.get(process.env['VUE_APP_LOGOUT_PATH']).finally(() => {
|
request.get(process.env['VUE_APP_LOGOUT_PATH']).finally(() => {
|
||||||
window.location = process.env.VUE_APP_LOGIN_PATH
|
window.location = process.env.VUE_APP_LOGIN_PATH
|
||||||
})
|
})
|
||||||
@ -47,7 +47,7 @@ function afterGetSetting(setting) {
|
|||||||
if (setting['SESSION_EXPIRE_AT_BROWSER_CLOSE']) {
|
if (setting['SESSION_EXPIRE_AT_BROWSER_CLOSE']) {
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
const csrfToken = getTokenFromCookie()
|
const csrfToken = getTokenFromCookie()
|
||||||
setTokenToCookie(csrfToken, '30s')
|
if (csrfToken) { setTokenToCookie(csrfToken, '30s') }
|
||||||
}, 10 * 1000)
|
}, 10 * 1000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user