feat(custom): 商家详情整改增加未登录引导弹窗
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-06-18 21:43:16 +08:00
parent 6f5d722e6e
commit 8ca7001e3f
12 changed files with 57 additions and 40 deletions

View File

@@ -28,7 +28,7 @@ const request = (
token: Taro.getStorageSync('token') || '',
},
success: ({ data }) => {
if (data.code !== 200) {
if (data.code !== 200 && data.code !== 401) {
if (!IGNORED_TIPS.includes(url)) {
Taro.showToast({
title: data.msg,
@@ -36,9 +36,26 @@ const request = (
});
}
reject(data);
} else {
resolve(data);
return;
}
if (data.code === 401) {
Taro.showModal({
title: '提示',
content: '你当前未登录,是否前往登录',
confirmText: '去登录',
cancelText: '取消',
success: ({ confirm }) => {
if (confirm) {
Taro.reLaunch({
url: '/pages/users/login/index',
});
}
},
});
reject(data);
return;
}
resolve(data);
},
fail: err => {
reject(err);