商户异常状态处理-0714

master
Lee-1203 2022-07-14 09:10:15 +08:00
parent 8127ffb547
commit f984d76d37
24 changed files with 82 additions and 19 deletions

View File

@ -46,9 +46,26 @@ const refreshTokenPage = () => {
}
flag = true;
}
// 切换商户
const checkBusiness = (msg,id)=>{
clearTimeout(authTimer);
uni.showToast({
title:msg,
icon:'none',
duration:1000
})
authTimer = setTimeout(()=>{
uni.reLaunch({ // 重新进入当前页面
url:`/pages/tabbar/index/index?business_id=${id}`
})
},1200)
flag = true;
}
// 请求错误处理
const checkError = (e) => {
console.log('500接口错误');
console.log(e,'500接口错误');
// console.error("----接口错误----", e)
if (e.data) {
if (e.data.code) {
@ -87,6 +104,14 @@ const checkError = (e) => {
refreshTokenPage();
}
break;
case 6002:
// 商户状态异常
if(flag) {
flag = false;
console.log('商户状态异常');
checkBusiness(e.data.msg,e.data.data.business_id);
}
break;
}
}
}

View File

@ -102,6 +102,9 @@
this.getHomeData();
this.getArticleNav();
userInfoEv();
}else{
// this.$toolAll.tools.showToast(res.msg);
}
})
}else{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -9108,9 +9108,26 @@ var refreshTokenPage = function refreshTokenPage() {
}
flag = true;
};
// 切换商户
var checkBusiness = function checkBusiness(msg, id) {
clearTimeout(authTimer);
uni.showToast({
title: msg,
icon: 'none',
duration: 1000 });
authTimer = setTimeout(function () {
uni.reLaunch({ // 重新进入当前页面
url: "/pages/tabbar/index/index?business_id=".concat(id) });
}, 1200);
flag = true;
};
// 请求错误处理
var checkError = function checkError(e) {
console.log('500接口错误');
console.log(e, '500接口错误');
// console.error("----接口错误----", e)
if (e.data) {
if (e.data.code) {
@ -9148,6 +9165,14 @@ var checkError = function checkError(e) {
// 调用刷新token事件并跳转到当前页面
refreshTokenPage();
}
break;
case 6002:
// 商户状态异常
if (flag) {
flag = false;
console.log('商户状态异常');
checkBusiness(e.data.msg, e.data.data.business_id);
}
break;}
}

View File

@ -269,6 +269,9 @@ var _default = {
_this.getHomeData();
_this.getArticleNav();
(0, _publicApi.userInfoEv)();
} else {
// this.$toolAll.tools.showToast(res.msg);
}
});
} else {

View File

@ -16,6 +16,13 @@
"query": "business_id=0",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/tabbar/index/index",
"query": "business_id=6",
"launchMode": "default",
"scene": null
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB