mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-08-06 10:57:25 +08:00
fix: 优化请求处理逻辑以增强稳定性
- 在 request.js 中添加异常处理,确保 uni.hideLoading() 调用不会导致错误 - 清理存储逻辑,提升代码健壮性
This commit is contained in:
@@ -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) ||
|
||||
|
||||
Reference in New Issue
Block a user