登录页重复弹框跳转
This commit is contained in:
parent
606fbe634e
commit
3620bd4fdf
|
|
@ -203,6 +203,11 @@ service.interceptors.response.use(
|
||||||
}
|
}
|
||||||
if (code === 401) {
|
if (code === 401) {
|
||||||
if (!isRelogin.show) {
|
if (!isRelogin.show) {
|
||||||
|
const currentPath = window.location.pathname
|
||||||
|
console.log('🚀 ~ currentPath:', currentPath)
|
||||||
|
// 👉 判断当前是否已经在登录页
|
||||||
|
if (currentPath === '/login') return // 已经在目标页,不再跳转
|
||||||
|
|
||||||
isRelogin.show = true
|
isRelogin.show = true
|
||||||
MessageBox.confirm(
|
MessageBox.confirm(
|
||||||
'登录状态已过期,您可以继续留在该页面,或者重新登录',
|
'登录状态已过期,您可以继续留在该页面,或者重新登录',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue