Commit 90bc40d3 authored by Wallen姚文辉's avatar Wallen姚文辉

修复页面变更轮询不停止的bug

parent 64b2e12b
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>yinhe_test</title><script defer="defer" src="/js/chunk-vendors.822ae491.js"></script><script defer="defer" src="/js/app.e1c3fdb4.js"></script><link href="/css/chunk-vendors.187ae3e6.css" rel="stylesheet"><link href="/css/app.7091cd70.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but yinhe_test doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html> <!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>yinhe_test</title><script defer="defer" src="/js/chunk-vendors.822ae491.js"></script><script defer="defer" src="/js/app.0681bd5d.js"></script><link href="/css/chunk-vendors.187ae3e6.css" rel="stylesheet"><link href="/css/app.7091cd70.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but yinhe_test doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file \ No newline at end of file
This diff is collapsed.
This diff is collapsed.
...@@ -564,6 +564,7 @@ export default { ...@@ -564,6 +564,7 @@ export default {
caseCount: 0, caseCount: 0,
fugailu: 0, fugailu: 0,
timeoutFun: [], timeoutFun: [],
quit: false,
} }
}, },
methods: { methods: {
...@@ -599,14 +600,15 @@ export default { ...@@ -599,14 +600,15 @@ export default {
}, },
getJenkinsInfo() { getJenkinsInfo() {
this.$request("get", '/tool/testport/runresult', null, this, (data) => { this.$request("get", '/tool/testport/runresult', null, this, (data) => {
this.jenkis_data = data.data; if (!this.quit) {
const funid = setTimeout(() => { this.jenkis_data = data.data;
this.getJenkinsInfo(); const funid = setTimeout(() => {
console.info(this.timeoutFun); this.getJenkinsInfo();
const index = this.timeoutFun.findIndex(ele => { return ele == funid }); const index = this.timeoutFun.findIndex(ele => { return ele == funid });
this.timeoutFun.splice(index, 1); this.timeoutFun.splice(index, 1);
}, 5000); }, 5000);
this.timeoutFun.push(funid) this.timeoutFun.push(funid)
}
}) })
}, },
breforerunjenkins() { breforerunjenkins() {
...@@ -852,6 +854,7 @@ export default { ...@@ -852,6 +854,7 @@ export default {
this.myname = JSON.parse(localStorage.getItem("userinfo")).name this.myname = JSON.parse(localStorage.getItem("userinfo")).name
}, },
beforeUnmount() { beforeUnmount() {
this.quit = true
this.timeoutFun.forEach(ele => { this.timeoutFun.forEach(ele => {
clearTimeout(ele) clearTimeout(ele)
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment