mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-01 06:58:01 +00:00
fix: 修复lina nginx
This commit is contained in:
@@ -2,7 +2,11 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
|
|
||||||
location /ui/ {
|
location /ui/ {
|
||||||
try_files $uri / /ui/index.html;
|
try_files $uri / /ui/index.html;
|
||||||
alias /opt/lina/;
|
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
|
const whiteList = ['/login', process.env.VUE_APP_LOGIN_PATH] // no redirect whitelist
|
||||||
let initial = false
|
let initial = false
|
||||||
|
|
||||||
|
function reject() {
|
||||||
|
return new Promise((resolve, reject) => reject())
|
||||||
|
}
|
||||||
|
|
||||||
function setHeadTitle({ to, from, next }) {
|
function setHeadTitle({ to, from, next }) {
|
||||||
document.title = getPageTitle(to.meta.title)
|
document.title = getPageTitle(to.meta.title)
|
||||||
}
|
}
|
||||||
@@ -20,7 +24,7 @@ async function checkLogin({ to, from, next }) {
|
|||||||
const hasToken = getToken()
|
const hasToken = getToken()
|
||||||
if (!hasToken) {
|
if (!hasToken) {
|
||||||
window.location = process.env.VUE_APP_LOGIN_PATH
|
window.location = process.env.VUE_APP_LOGIN_PATH
|
||||||
return
|
return reject()
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -28,6 +32,7 @@ async function checkLogin({ to, from, next }) {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
// return false
|
// return false
|
||||||
window.location = process.env.VUE_APP_LOGIN_PATH
|
window.location = process.env.VUE_APP_LOGIN_PATH
|
||||||
|
return reject()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user