更改Nginx

main
小霞 2025-02-06 12:46:13 +08:00
parent 37561068a3
commit 8dce49766f
2 changed files with 7 additions and 1 deletions

View File

@ -17,6 +17,11 @@ server {
root /etc/nginx/html/ocr-server-admin/;
try_files /index.html =404;
}
# 处理 /index 路径
location = /login {
root /etc/nginx/html/ocr-server-admin/;
try_files /index.html =404;
}
# 处理其他静态文件
location ~* \.html$ {

View File

@ -11,10 +11,11 @@ const handleCode = async (code: number, msg: string) => {
const router = useRouter();
switch (code) {
case 401:
debugger
ElMessage.error(msg || '登录失效')
setTimeout(() => {
console.log('登录失效')
router.push("/login")
// router.replace("/login")
}, 1500)
// 跳转登录
break