mirror of
https://github.com/jumpserver/lina.git
synced 2025-05-13 02:24:21 +00:00
fix: 修复lina nginx
This commit is contained in:
parent
c38b1cdb8a
commit
3df6af53cb
@ -2,7 +2,11 @@ server {
|
||||
listen 80;
|
||||
|
||||
location /ui/ {
|
||||
try_files $uri / /ui/index.html;
|
||||
alias /opt/lina/;
|
||||
try_files $uri / /ui/index.html;
|
||||
alias /opt/lina/;
|
||||
}
|
||||
|
||||
location / {
|
||||
rewrite ^/(.*)$ /ui/$1 last;
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,10 @@ import { getPermission, getToken, setPermission } from '@/utils/auth'
|
||||
const whiteList = ['/login', process.env.VUE_APP_LOGIN_PATH] // no redirect whitelist
|
||||
let initial = false
|
||||
|
||||
function reject() {
|
||||
return new Promise((resolve, reject) => reject())
|
||||
}
|
||||
|
||||
function setHeadTitle({ to, from, next }) {
|
||||
document.title = getPageTitle(to.meta.title)
|
||||
}
|
||||
@ -20,7 +24,7 @@ async function checkLogin({ to, from, next }) {
|
||||
const hasToken = getToken()
|
||||
if (!hasToken) {
|
||||
window.location = process.env.VUE_APP_LOGIN_PATH
|
||||
return
|
||||
return reject()
|
||||
}
|
||||
|
||||
try {
|
||||
@ -28,6 +32,7 @@ async function checkLogin({ to, from, next }) {
|
||||
} catch (e) {
|
||||
// return false
|
||||
window.location = process.env.VUE_APP_LOGIN_PATH
|
||||
return reject()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user