feat: 授权后token刷新保持

This commit is contained in:
duanshuwen
2025-11-18 19:40:28 +08:00
parent de272b1160
commit de412aed9c
9 changed files with 40 additions and 45 deletions

View File

@@ -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();
}