- reject前删除_suppressToast内部标记,避免泄漏到外层调用方 - fetchBanner增加空catch避免未处理rejection Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@@ -626,7 +626,7 @@ const fetchCharging = () => {
const fetchBanner = () => {
fetchHomeBanner().then((res) => {
mapBanner.value = res.filter((item: any) => item.status === 1);
- });
+ }).catch(() => {});
};
// const checkDiscounts = () => {
@@ -106,7 +106,11 @@ class Http {
}
})
.catch((err) => {
- if (err && err.errMsg && !err._suppressToast && options && options.statusCodeHandle) {
+ const suppressToast = err && err._suppressToast;
+ if (err) {
+ delete err._suppressToast;
+ }
+ if (err && err.errMsg && !suppressToast && options && options.statusCodeHandle) {
uni.showToast({
title: `${err.errMsg}`,
icon: "none",