refactor(utils): 增加全局提示忽略白名单
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -10,6 +10,9 @@ interface Res<T> {
|
||||
|
||||
type Method = "GET" | "POST" | "PUT" | "DELETE";
|
||||
|
||||
// 忽略系统提示白名单
|
||||
const IGNORED_TIPS = ["/user/find/phone"];
|
||||
|
||||
const request = (
|
||||
url: string,
|
||||
data: object = {},
|
||||
@@ -26,10 +29,12 @@ const request = (
|
||||
},
|
||||
success: ({ data }) => {
|
||||
if (data.code !== 200) {
|
||||
Taro.showToast({
|
||||
title: data.msg,
|
||||
icon: "none",
|
||||
});
|
||||
if (!IGNORED_TIPS.includes(url)) {
|
||||
Taro.showToast({
|
||||
title: data.msg,
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
reject(data);
|
||||
} else {
|
||||
resolve(data);
|
||||
|
||||
Reference in New Issue
Block a user