feat(custom): 商家详情整改增加未登录引导弹窗
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user