浏览代码

登录过期跳转页面

lex 3 年之前
父节点
当前提交
410f3b21d8
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/helpers/request.ts

+ 1 - 1
src/helpers/request.ts

@@ -84,7 +84,7 @@ request.interceptors.response.use(
 
       if (data.code === 403) {
         removeAuth()
-        window.location.href = location.origin
+        window.location.href = location.origin + location.pathname
         ElMessage.error('登录已过期,请重新登录')
       }
       throw new Error(msg)