scorpio 3 years ago
parent
commit
1ab72b95ee
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/api/fetch.js

+ 1 - 1
src/api/fetch.js

@@ -55,7 +55,7 @@ function fetch (url = '', params = {}, method = 'get', contentType = 'form', hea
         statusText
       } = response
       if (status >= 200 && status <= 401) {
-        if (data.code === 401) { // 未登录c
+        if (data.code === 401 || data.code === 400) { // 未登录c
           removeToken()
           router.push(`/?redirect=${encodeURIComponent(window.location.href)}`)
           reject(new Error('需要登录'))