【代码优化】特殊:处理分销用户绑定失败的提示

pull/134/head
puhui999 2025-01-10 16:20:58 +08:00
parent c1f2117e48
commit 039f05ce23
1 changed files with 11 additions and 10 deletions

View File

@ -80,13 +80,13 @@ http.interceptors.request.use(
if (config.custom.showLoading) { if (config.custom.showLoading) {
LoadingInstance.count++; LoadingInstance.count++;
LoadingInstance.count === 1 && LoadingInstance.count === 1 &&
uni.showLoading({ uni.showLoading({
title: config.custom.loadingMsg, title: config.custom.loadingMsg,
mask: true, mask: true,
fail: () => { fail: () => {
uni.hideLoading(); uni.hideLoading();
}, },
}); });
} }
// 增加 token 令牌、terminal 终端、tenant 租户的请求头 // 增加 token 令牌、terminal 终端、tenant 租户的请求头
@ -124,9 +124,10 @@ http.interceptors.response.use(
if (response.data.code === 401) { if (response.data.code === 401) {
return refreshToken(response.config); return refreshToken(response.config);
} }
// 特殊:处理分销用户绑定失败的提示
// 错误提示 if ((response.data.code + '').includes('1011007')) {
if (response.config.custom.showError) { console.error(`分销用户绑定失败,原因:${response.data.msg}`);
} else if (response.config.custom.showError) { // 错误提示
uni.showToast({ uni.showToast({
title: response.data.msg || '服务器开小差啦,请稍后再试~', title: response.data.msg || '服务器开小差啦,请稍后再试~',
icon: 'none', icon: 'none',