fix: 优化请求处理逻辑以增强稳定性

- 在 request.js 中添加异常处理,确保 uni.hideLoading() 调用不会导致错误
- 清理存储逻辑,提升代码健壮性
This commit is contained in:
Yer11214
2026-07-13 15:59:38 +08:00
parent 7566076fa4
commit 38defd1201

View File

@@ -22,9 +22,9 @@ function cleanStorage() {
icon: "none",
duration: 1500,
});
if (uni.showLoading()) {
try {
uni.hideLoading();
}
} catch (e) {}
storage.setHasLogin(false);
storage.setAccessToken("");
@@ -144,7 +144,9 @@ http.interceptors.response.use(
// cleanStorage();
// isRefreshing = false;
// }
uni.showLoading() ? uni.hideLoading() : ''
try {
uni.hideLoading();
} catch (e) {}
let token = storage.getAccessToken();
if (
(token && response.statusCode === 403) ||