Commit a8c3e44a authored by hubaoshan's avatar hubaoshan

页面的token Bug

parent 16670525
......@@ -243,13 +243,20 @@ watch(
if(route.path === '/AIStation/Extinguisher') {
// 路由变化,执行相应操作
handleGetAIToken();
setTimeout(() => {
if(localStorage.getItem('AIToken')){
getNumber()
getData()
// setTimeout(() => {
// if(localStorage.getItem('AIToken')){
// getNumber()
// getData()
// }
// }, 500);
// 轮询检测 localStorage 是否更新
const checkAIToken = setInterval(() => {
if (localStorage.getItem('AIToken')) {
clearInterval(checkAIToken); // 停止轮询
getNumber();
getData();
}
}, 500);
}, 100); // 每100ms检查一次
console.log('route.path', route.path)
}
},
......
......@@ -243,12 +243,20 @@ watch(
if(route.path === '/AIStation/MoveMonitor') {
// 路由变化,执行相应操作
handleGetAIToken();
setTimeout(() => {
if(localStorage.getItem('AIToken')){
getNumber()
getData()
// setTimeout(() => {
// if(localStorage.getItem('AIToken')){
// getNumber()
// getData()
// }
// }, 500);
// 轮询检测 localStorage 是否更新
const checkAIToken = setInterval(() => {
if (localStorage.getItem('AIToken')) {
clearInterval(checkAIToken); // 停止轮询
getNumber();
getData();
}
}, 500);
}, 100); // 每100ms检查一次
console.log('route.path', route.path)
}
},
......
......@@ -268,13 +268,20 @@ watch(
if(route.path === '/AIStation/PipelineTemp') {
// 路由变化,执行相应操作
handleGetAIToken();
setTimeout(() => {
if(localStorage.getItem('AIToken')){
getNumber()
getData()
// setTimeout(() => {
// if(localStorage.getItem('AIToken')){
// getNumber()
// getData()
// }
// }, 500);
// 轮询检测 localStorage 是否更新
const checkAIToken = setInterval(() => {
if (localStorage.getItem('AIToken')) {
clearInterval(checkAIToken); // 停止轮询
getNumber();
getData();
}
}, 500);
}, 100); // 每100ms检查一次
console.log('route.path', route.path)
}
},
......
......@@ -277,13 +277,20 @@ watch(
if(route.path === '/AIStation/TransTemp') {
// 路由变化,执行相应操作
handleGetAIToken();
setTimeout(() => {
if(localStorage.getItem('AIToken')){
getNumber()
getData()
// setTimeout(() => {
// if(localStorage.getItem('AIToken')){
// getNumber()
// getData()
// }
// }, 500);
// 轮询检测 localStorage 是否更新
const checkAIToken = setInterval(() => {
if (localStorage.getItem('AIToken')) {
clearInterval(checkAIToken); // 停止轮询
getNumber();
getData();
}
}, 500);
}, 100); // 每100ms检查一次
console.log('route.path', route.path)
}
},
......
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