登录页重复弹框跳转

This commit is contained in:
bb_pan 2025-09-08 09:46:52 +08:00
parent 606fbe634e
commit 3620bd4fdf
1 changed files with 5 additions and 0 deletions

View File

@ -203,6 +203,11 @@ service.interceptors.response.use(
}
if (code === 401) {
if (!isRelogin.show) {
const currentPath = window.location.pathname
console.log('🚀 ~ currentPath:', currentPath)
// 👉 判断当前是否已经在登录页
if (currentPath === '/login') return // 已经在目标页,不再跳转
isRelogin.show = true
MessageBox.confirm(
'登录状态已过期,您可以继续留在该页面,或者重新登录',