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