From a17543b95c52b8e9b07b241fce92c5a0d69eea68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=A1=E5=A4=8D=E4=B9=A0?= <2353956224@qq.com> Date: Tue, 21 Apr 2026 17:01:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=B8=8B=E9=99=90=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/HostListDialog.vue | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/components/HostListDialog.vue b/src/components/HostListDialog.vue index f9aa28d..29f2e2f 100644 --- a/src/components/HostListDialog.vue +++ b/src/components/HostListDialog.vue @@ -278,7 +278,6 @@ const emit = defineEmits(['close', 'save']) const { controlCheckTask } = usePythonBridge() const HOST_LIST_MIN_COUNT_KEY = 'host_list_dialog_min_count' -const HOST_LIST_GATE_ENABLED_KEY = 'host_list_dialog_gate_enabled' const HOST_LIST_GATE_STATE_KEY = 'host_list_dialog_gate_state' const HOST_LIST_MONITOR_INTERVAL_MS = 30000 @@ -401,7 +400,6 @@ const parsedIds = computed(() => { watch(() => props.visible, (newVal) => { if (newVal) { document.body.style.overflow = 'hidden' - loadLocalGateConfig() loadHosts() loadConfig() } else { @@ -510,8 +508,8 @@ const stopHostListMonitor = () => { const loadLocalGateConfig = () => { try { - const savedGateEnabled = localStorage.getItem(HOST_LIST_GATE_ENABLED_KEY) - gateEnabled.value = savedGateEnabled === 'true' + gateEnabled.value = false + localStorage.removeItem(HOST_LIST_GATE_ENABLED_KEY) const savedMinCount = localStorage.getItem(HOST_LIST_MIN_COUNT_KEY) if (savedMinCount !== null && savedMinCount !== '') { @@ -521,12 +519,8 @@ const loadLocalGateConfig = () => { } } - const savedGateState = localStorage.getItem(HOST_LIST_GATE_STATE_KEY) - if (savedGateState === 'true') { - checkTaskGateState.value = true - } else if (savedGateState === 'false') { - checkTaskGateState.value = false - } + checkTaskGateState.value = null + localStorage.removeItem(HOST_LIST_GATE_STATE_KEY) } catch (e) { console.error('[HostListDialog] 读取本地门控配置失败:', e) }