Commit 524a4348 by 李伟康

fix(api/components): 修复 HTTP 请求和消息提示相关问题

- 在 HTTP 请求中添加方法日志输出
- 优化首页左侧组件的跟踪功能和跳转逻辑
- 修复组件生命周期中的定时器管理问题
1 parent 5f10cadf
...@@ -79,6 +79,7 @@ class Request { ...@@ -79,6 +79,7 @@ class Request {
return; return;
} }
if (code == 20 || code == 21) { if (code == 20 || code == 21) {
console.log(params.method)
const pages = getCurrentPages(), const pages = getCurrentPages(),
currentPage = pages[pages.length - 1] currentPage = pages[pages.length - 1]
uni.hideLoading(); uni.hideLoading();
......
...@@ -191,6 +191,7 @@ export default { ...@@ -191,6 +191,7 @@ export default {
}) })
}, },
startTrack () { startTrack () {
if(this.trackInterval) clearInterval(this.trackInterval)
this.trackInterval = setInterval(() => { this.trackInterval = setInterval(() => {
this.leaveTrack() this.leaveTrack()
}, 5000) }, 5000)
...@@ -225,6 +226,7 @@ export default { ...@@ -225,6 +226,7 @@ export default {
this.$emit('closeTips') this.$emit('closeTips')
try { try {
jumpUrl = await this.findBeiSenSSOToken() jumpUrl = await this.findBeiSenSSOToken()
this.jumpUrl = jumpUrl
} catch (error) { } catch (error) {
console.log(error) console.log(error)
} }
...@@ -350,6 +352,11 @@ export default { ...@@ -350,6 +352,11 @@ export default {
}, },
beforeCreate () { beforeCreate () {
clearInterval(this.trackInterval) clearInterval(this.trackInterval)
this.trackInterval = null
},
beforeDestroy() {
clearInterval(this.trackInterval)
this.trackInterval = null
}, },
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!