Browse Source

请求新增状态码判断 500 提示文字修改

newStyle
douzhuo 2 years ago
parent
commit
e7362fe992
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      src/router/axios.js

+ 1
- 2
src/router/axios.js View File

@@ -63,12 +63,11 @@ axios.interceptors.response.use(res => {
NProgress.done() NProgress.done()
const status = Number(res.status) || 200 const status = Number(res.status) || 200
const message = res.data.msg || errorCode[status] || errorCode['default'] const message = res.data.msg || errorCode[status] || errorCode['default']

if (status === 401 || status === 500) { if (status === 401 || status === 500) {
idx++ idx++
if(idx==1){ if(idx==1){
Message({ Message({
message: message,
message: '当前登录状态异常,请重新登录~',
type: 'error' type: 'error'
}) })
} }


Loading…
Cancel
Save