Commit b56898858d829a314b9209fb6b05dac01ff5ef6a
1 parent
21d07c1d
超时登录后页面跳转到首页
Showing
1 changed file
with
2 additions
and
5 deletions
ruoyi-ui/src/utils/request.js
| ... | ... | @@ -32,17 +32,14 @@ service.interceptors.response.use(res => { |
| 32 | 32 | // 获取错误信息 |
| 33 | 33 | const msg = errorCode[code] || res.data.msg || errorCode['default'] |
| 34 | 34 | if (code === 401) { |
| 35 | - MessageBox.confirm( | |
| 36 | - '登录状态已过期,您可以继续留在该页面,或者重新登录', | |
| 37 | - '系统提示', | |
| 38 | - { | |
| 35 | + MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { | |
| 39 | 36 | confirmButtonText: '重新登录', |
| 40 | 37 | cancelButtonText: '取消', |
| 41 | 38 | type: 'warning' |
| 42 | 39 | } |
| 43 | 40 | ).then(() => { |
| 44 | 41 | store.dispatch('LogOut').then(() => { |
| 45 | - location.reload() // 为了重新实例化vue-router对象 避免bug | |
| 42 | + location.href = '/index'; | |
| 46 | 43 | }) |
| 47 | 44 | }) |
| 48 | 45 | } else if (code === 500) { | ... | ... |