scorpio 3 vuotta sitten
vanhempi
commit
600987faf4
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      src/api/fetch.js

+ 2 - 1
src/api/fetch.js

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