Commit 2729bc35 authored by 皮倩雯's avatar 皮倩雯

fix: '增加接口循环调用时间'

parent d92e639f
Pipeline #77092 passed with stages
......@@ -43,8 +43,10 @@ const LookModal = props => {
const fixedVariable = useRef(['昨天', '今天', '上周', '本周', '本月', '上月', '自定义']);
useEffect(() => {
getSiteList();
getLogList();
if (visible) {
getSiteList();
getLogList();
}
}, [visible]);
const getSiteList = () => {
......
/* eslint-disable func-names */
/* eslint-disable no-else-return */
/* eslint-disable no-unneeded-ternary */
import React, { useState, useEffect, useRef } from 'react';
......@@ -186,29 +187,6 @@ const ScheduledTasks = () => {
}, []);
const getIISAgentLog = () => {
// const worker = new Worker('logWorker.js');
// GetIISAgentLog().then(res => {
// if (res.code === 0) {
// debugger;
// worker.postMessage(res.data);
// worker.onmessage = e => {
// setLogList(e.data);
// debugger;
// scroll.current.scrollTop = scroll.current.scrollHeight;
// timer = setTimeout(() => {
// getIISAgentLog();
// }, 2000);
// };
// } else {
// notification.error({
// message: '提示',
// duration: 3,
// description: res.msg,
// });
// clearInterval(timer);
// timer = null;
// }
// });
GetIISAgentLog().then(res => {
if (res.code === 0) {
let arr = [];
......@@ -242,7 +220,7 @@ const ScheduledTasks = () => {
scroll.current.scrollTop = scroll.current.scrollHeight;
timer = setTimeout(() => {
getIISAgentLog();
}, 2000);
}, 5000);
} else {
notification.error({
message: '提示',
......
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