优化某些情况下登录权限问题
parent
93fc20c825
commit
7633f84385
|
@ -112,7 +112,7 @@ http.interceptors.response.use(
|
|||
// cleanStorage();
|
||||
// isRefreshing = false;
|
||||
// }
|
||||
|
||||
console.log(response)
|
||||
let token = storage.getAccessToken();
|
||||
if (
|
||||
(token && response.statusCode === 403) ||
|
||||
|
@ -131,7 +131,7 @@ http.interceptors.response.use(
|
|||
|
||||
response.header.accessToken = `${accessToken}`;
|
||||
// token 刷新后将数组的方法重新执行
|
||||
console.log('接口队列',requests,'新token',accessToken)
|
||||
// console.log('接口队列', requests, '新token', accessToken)
|
||||
requests.forEach((cb) => cb(accessToken));
|
||||
requests = []; // 重新请求完清空
|
||||
return http.request(response.config);
|
||||
|
@ -154,13 +154,12 @@ http.interceptors.response.use(
|
|||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 如果当前返回没登录
|
||||
} else if (
|
||||
(!token && !storage.getRefreshToken() && response.statusCode === 403) ||
|
||||
response.data.code === 403
|
||||
response.data.code === 403 || response.data.code === 20004
|
||||
) {
|
||||
console.log('没有token 以及刷新token 内容',token,storage.getRefreshToken())
|
||||
// console.log('没有token 以及刷新token 内容', token, storage.getRefreshToken())
|
||||
cleanStorage();
|
||||
|
||||
// 如果当前状态码为正常但是success为不正常时
|
||||
|
|
Loading…
Reference in New Issue