refactor(utils): 增加全局提示忽略白名单
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-03-15 17:12:07 +08:00
parent aef52631e7
commit 2646d025f4
4 changed files with 10 additions and 9 deletions

View File

@@ -84,8 +84,7 @@ const formSubmit = async ({ detail }: any) => {
icon: "none",
});
try {
const res = await checkPhone({ phone: detail.value.phone });
console.log(res);
await checkPhone({ phone: detail.value.phone });
const user_info = await Taro.getStorageSync("userInfo");
Taro.navigateTo({
url: `/pages/admin/add_order/add_menu/index?type=1&bid=${user_info.data.bid}&seat=${formVal.value.seat}&phone=${formVal.value.phone}&notes=${formVal.value.notes}`,

View File

@@ -45,7 +45,6 @@
</view>
</view>
</view>
<view class="btn" @click="ok">立即收款</view>
</view>
</template>
@@ -69,7 +68,6 @@ const get_data = async ({ bid, oid }) => {
});
const res = await getAfterOrder({ bid, oid });
data.value = res.data.data;
console.log(res);
Taro.hideLoading();
};

View File

@@ -23,7 +23,6 @@ const info = ref<any>({});
Taro.useLoad((e) => {
info.value = e;
console.log(e);
code.value = Taro.getStorageSync("pay_code");
time_id.value = setInterval(async () => {
const { data } = await getAfterOrder({

View File

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