feat: 授权后token刷新保持
This commit is contained in:
@@ -25,6 +25,7 @@ function request(url, args = {}, method = "POST", customConfig = {}) {
|
||||
...defaultConfig.header,
|
||||
...customConfig.header,
|
||||
};
|
||||
|
||||
// 判断是否需要 token
|
||||
if (customConfig.noToken) {
|
||||
delete header.Authorization;
|
||||
@@ -58,8 +59,6 @@ function request(url, args = {}, method = "POST", customConfig = {}) {
|
||||
if (res.statusCode && res.statusCode === 424) {
|
||||
console.log("424错误,重新登录");
|
||||
uni.setStorageSync("token", "");
|
||||
appStore.setHasToken(false);
|
||||
appStore.setTokenExpired(true);
|
||||
uni.$emit(NOTICE_EVENT_LOGOUT);
|
||||
goLogin();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user