From 8dce49766f4dc3dd26c74f5440790abf756ce8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=9C=9E?= <1571974166@qq.com> Date: Thu, 6 Feb 2025 12:46:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9Nginx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builds/nginx.conf | 5 +++++ src/utils/request.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/builds/nginx.conf b/builds/nginx.conf index 7c83b63..57bd436 100644 --- a/builds/nginx.conf +++ b/builds/nginx.conf @@ -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$ { diff --git a/src/utils/request.ts b/src/utils/request.ts index d469a41..c89fe5f 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -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