1
0
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:
ibuler 2020-06-01 15:54:15 +08:00
parent c38b1cdb8a
commit 3df6af53cb
2 changed files with 12 additions and 3 deletions

View File

@ -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;
}
}

View File

@ -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()
}
}