商户异常状态处理-0714
parent
8127ffb547
commit
f984d76d37
|
@ -46,9 +46,26 @@ const refreshTokenPage = () => {
|
||||||
}
|
}
|
||||||
flag = true;
|
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) => {
|
const checkError = (e) => {
|
||||||
console.log('500接口错误');
|
console.log(e,'500接口错误');
|
||||||
// console.error("----接口错误----", e)
|
// console.error("----接口错误----", e)
|
||||||
if (e.data) {
|
if (e.data) {
|
||||||
if (e.data.code) {
|
if (e.data.code) {
|
||||||
|
@ -87,6 +104,14 @@ const checkError = (e) => {
|
||||||
refreshTokenPage();
|
refreshTokenPage();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 6002:
|
||||||
|
// 商户状态异常
|
||||||
|
if(flag) {
|
||||||
|
flag = false;
|
||||||
|
console.log('商户状态异常');
|
||||||
|
checkBusiness(e.data.msg,e.data.data.business_id);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,6 +102,9 @@
|
||||||
this.getHomeData();
|
this.getHomeData();
|
||||||
this.getArticleNav();
|
this.getArticleNav();
|
||||||
userInfoEv();
|
userInfoEv();
|
||||||
|
}else{
|
||||||
|
// this.$toolAll.tools.showToast(res.msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}else{
|
}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
|
@ -9108,9 +9108,26 @@ var refreshTokenPage = function refreshTokenPage() {
|
||||||
}
|
}
|
||||||
flag = true;
|
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) {
|
var checkError = function checkError(e) {
|
||||||
console.log('500接口错误');
|
console.log(e, '500接口错误');
|
||||||
// console.error("----接口错误----", e)
|
// console.error("----接口错误----", e)
|
||||||
if (e.data) {
|
if (e.data) {
|
||||||
if (e.data.code) {
|
if (e.data.code) {
|
||||||
|
@ -9148,6 +9165,14 @@ var checkError = function checkError(e) {
|
||||||
// 调用刷新token事件并跳转到当前页面
|
// 调用刷新token事件并跳转到当前页面
|
||||||
refreshTokenPage();
|
refreshTokenPage();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case 6002:
|
||||||
|
// 商户状态异常
|
||||||
|
if (flag) {
|
||||||
|
flag = false;
|
||||||
|
console.log('商户状态异常');
|
||||||
|
checkBusiness(e.data.msg, e.data.data.business_id);
|
||||||
|
}
|
||||||
break;}
|
break;}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,6 +269,9 @@ var _default = {
|
||||||
_this.getHomeData();
|
_this.getHomeData();
|
||||||
_this.getArticleNav();
|
_this.getArticleNav();
|
||||||
(0, _publicApi.userInfoEv)();
|
(0, _publicApi.userInfoEv)();
|
||||||
|
} else {
|
||||||
|
// this.$toolAll.tools.showToast(res.msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -16,6 +16,13 @@
|
||||||
"query": "business_id=0",
|
"query": "business_id=0",
|
||||||
"launchMode": "default",
|
"launchMode": "default",
|
||||||
"scene": null
|
"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 |
Loading…
Reference in New Issue