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