diff --git a/src/components/common/log-drawer.vue b/src/components/common/log-drawer.vue index dd1e67f..d51b35a 100644 --- a/src/components/common/log-drawer.vue +++ b/src/components/common/log-drawer.vue @@ -32,21 +32,19 @@ const visible = defineModel('show', { const syncTime = ref(1); const logList = ref([]); const interval = ref(); -const controller = new AbortController(); +let controller = new AbortController(); const finished = ref(true); let startId = '0'; let fromIndex: number = 0; -let axiosController = new AbortController(); const pauseLog = () => { finished.value = true; - controller.abort(); clearTimeout(interval.value); interval.value = undefined; }; const stopLog = () => { - if (!finished.value) axiosController.abort(); + if (!finished.value) controller.abort(); pauseLog(); startId = '0'; fromIndex = 0; @@ -68,7 +66,7 @@ async function getLogList() { fromIndex, size: 50 }, - axiosController + controller ); logData = data; logError = error; @@ -119,7 +117,7 @@ watch( if ((val || !props.drawer) && props.type && props.taskData) { finished.value = false; - axiosController = new AbortController(); + controller = new AbortController(); await getLogList(); } @@ -265,7 +263,7 @@ const SnailLogComponent = defineComponent({