scorpio 3 년 전
부모
커밋
1ab72b95ee
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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('需要登录'))