From 185651ef475779a62f510c26d86152e349fe8e3a Mon Sep 17 00:00:00 2001 From: wangxia <779219182@qq.com> Date: Tue, 12 Aug 2025 15:45:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 12 +++--------- utils/ajax.js | 41 ++++++++++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/App.vue b/App.vue index e0b5cf6..f42a097 100644 --- a/App.vue +++ b/App.vue @@ -47,7 +47,6 @@ export default { that.G.watchUserPage(args.url); }, }); - }, onShow: function (options) { let that = this; @@ -79,14 +78,10 @@ export default { this.G.checkToken(); } if (!that.globalData.timer) { - if (uni.getStorageSync("apply-token")) { - that.checkNum(); - } + that.checkNum(); that.globalData.timer = setInterval(() => { - console.log("inner++++++++++++++++++++ +++++++++++++++++++++++++++"); - if (uni.getStorageSync("apply-token")) { - that.checkNum(); - } + console.log("inner+++++++++++++++++++++++++++++++++++++++++++++++"); + that.checkNum(); }, 30 * 1000); } @@ -109,7 +104,6 @@ export default { } }, methods: { - initWyyx() { let that = this; diff --git a/utils/ajax.js b/utils/ajax.js index aadb6c7..5328da7 100644 --- a/utils/ajax.js +++ b/utils/ajax.js @@ -48,7 +48,7 @@ let data = { } // #endif params = { - 'requestComeFrom':'assistant_miniapp', + 'requestComeFrom': 'assistant_miniapp', // #ifdef APP-PLUS 'g-open-env': 'APP-PLUS', appId: uuid_new, @@ -116,7 +116,7 @@ let data = { // console.log('测试报错123123123123123123',res); // console.log('测试报错123123123123123123$url',$url); let resData = res.data; - + if (resData.status == 200) {// 正常 callback(resData.data, resData.msg); } else if (resData.status == 9999) {// 登录过期或者身份变动等需要登录的场景 @@ -138,14 +138,14 @@ let data = { // } else { uni.showToast({ title: resData.msg, - // title:'系统异常,请稍后', + // title:'系统异常,请稍后', icon: "none" }); failback(resData.msg); // } } else if (resData.status == 2002) { uni.showToast({ - title:'已切换团队,需要重新登录', + title: '已切换团队,需要重新登录', icon: "none" }); setTimeout(() => { @@ -154,23 +154,23 @@ let data = { }); }, 1500); } else {// 其他异常 - if($url == '/yishoudan/user/apply/order/V2/details'){ - - }else{ - uni.showToast({ - title: resData.msg, - icon: "none" - }); - } - - + if ($url == '/yishoudan/user/apply/order/V2/details') { + + } else { + uni.showToast({ + title: resData.msg, + icon: "none" + }); + } + + failback(resData.msg); } }, fail (error) { uni.showToast({ // title: error.errMsg, - title:'系统异常,请稍后', + title: '系统异常,请稍后', icon: "none" }) failback(error); @@ -211,6 +211,17 @@ let data = { }; } }, + //监听用户的页面点击 + watchUserPage (path) { + let that = this; + try { + if (uni.getStorageSync("apply-userinfo")) { + that.Post("/common/user/browsing/history/addRecord", { browsingUrl: path }, (res) => { }); + } + } catch (error) { + console.log("error", error); + } + }, }; export default data; \ No newline at end of file