Commit e23372f5 by 李伟康

commit 公共接口拦截

1 parent d81ad6c5
...@@ -14,16 +14,7 @@ export default { ...@@ -14,16 +14,7 @@ export default {
keepScreenOn: true, keepScreenOn: true,
}); });
}, },
onShow: function () { onShow: function () {},
const userInfo = uni.$storage.get('userInfo') || {}
if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) {
uni.$storage.rm("userInfo");
uni.$storage.rm("sessionId");
uni.reLaunch({
url: "/pages/common/login",
})
}
},
onHide: function () { onHide: function () {
if (this.isStart && !this.isEnd) { if (this.isStart && !this.isEnd) {
console.log("录音"); console.log("录音");
......
...@@ -30,6 +30,14 @@ class Request { ...@@ -30,6 +30,14 @@ class Request {
); );
} }
request(RequestMethods, params, returnAll, hostType = "dj") { request(RequestMethods, params, returnAll, hostType = "dj") {
const userInfo = uni.$storage.get('userInfo') || {}
if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) {
uni.$storage.rm("userInfo");
uni.$storage.rm("sessionId");
uni.reLaunch({
url: "/pages/common/login",
})
}
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let header = let header =
RequestMethods === "POST" RequestMethods === "POST"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!