mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-02 07:27:01 +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
|
||||
const hasToken = getTokenFromCookie()
|
||||
if (!hasToken) {
|
||||
if (!hasToken || hasToken === 'null') {
|
||||
request.get(process.env['VUE_APP_LOGOUT_PATH']).finally(() => {
|
||||
window.location = process.env.VUE_APP_LOGIN_PATH
|
||||
})
|
||||
@ -47,7 +47,7 @@ function afterGetSetting(setting) {
|
||||
if (setting['SESSION_EXPIRE_AT_BROWSER_CLOSE']) {
|
||||
setInterval(() => {
|
||||
const csrfToken = getTokenFromCookie()
|
||||
setTokenToCookie(csrfToken, '30s')
|
||||
if (csrfToken) { setTokenToCookie(csrfToken, '30s') }
|
||||
}, 10 * 1000)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user