From 3b141e2060c3cb780016c25a2a5a2c16fd85edf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=A1=E5=A4=8D=E4=B9=A0?= <2353956224@qq.com> Date: Wed, 22 Apr 2026 09:54:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4autotk=E4=B8=BAwebai=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/HostListDialog.vue | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/components/HostListDialog.vue b/src/components/HostListDialog.vue index e023d86..fb0ea69 100644 --- a/src/components/HostListDialog.vue +++ b/src/components/HostListDialog.vue @@ -278,7 +278,8 @@ const emit = defineEmits(['close', 'save']) const { controlCheckTask } = usePythonBridge() const HOST_LIST_MIN_COUNT_KEY = 'host_list_dialog_min_count' -const HOST_LIST_GATE_STATE_KEY = 'host_list_dialog_gate_state' +const HOST_LIST_GATE_ENABLED_SESSION_KEY = 'host_list_dialog_gate_enabled_session' +const HOST_LIST_GATE_STATE_SESSION_KEY = 'host_list_dialog_gate_state_session' const HOST_LIST_MONITOR_INTERVAL_MS = 30000 // Level Options @@ -342,7 +343,7 @@ let hostListMonitorTimer = null const resolveRestrictedMaxAnchorCount = (fallbackValue = 9999999) => { const permissions = getPermissions() - return permissions?.autotk === 1 ? fallbackValue : 0 + return permissions?.webAi === 1 ? fallbackValue : 0 } // 添加主播弹窗状态 @@ -508,8 +509,8 @@ const stopHostListMonitor = () => { const loadLocalGateConfig = () => { try { - gateEnabled.value = false - localStorage.removeItem(HOST_LIST_GATE_ENABLED_KEY) + const savedGateEnabled = sessionStorage.getItem(HOST_LIST_GATE_ENABLED_SESSION_KEY) + gateEnabled.value = savedGateEnabled === 'true' const savedMinCount = localStorage.getItem(HOST_LIST_MIN_COUNT_KEY) if (savedMinCount !== null && savedMinCount !== '') { @@ -519,8 +520,14 @@ const loadLocalGateConfig = () => { } } - checkTaskGateState.value = null - localStorage.removeItem(HOST_LIST_GATE_STATE_KEY) + const savedGateState = sessionStorage.getItem(HOST_LIST_GATE_STATE_SESSION_KEY) + if (savedGateState === 'true') { + checkTaskGateState.value = true + } else if (savedGateState === 'false') { + checkTaskGateState.value = false + } else { + checkTaskGateState.value = null + } } catch (e) { console.error('[HostListDialog] 读取本地门控配置失败:', e) } @@ -528,7 +535,7 @@ const loadLocalGateConfig = () => { const persistGateEnabled = () => { try { - localStorage.setItem(HOST_LIST_GATE_ENABLED_KEY, String(gateEnabled.value)) + sessionStorage.setItem(HOST_LIST_GATE_ENABLED_SESSION_KEY, String(gateEnabled.value)) } catch (e) { console.error('[HostListDialog] 保存上下限模式失败:', e) } @@ -550,11 +557,11 @@ const persistMinCount = () => { const persistGateState = (value) => { try { if (value === null || value === undefined) { - localStorage.removeItem(HOST_LIST_GATE_STATE_KEY) + sessionStorage.removeItem(HOST_LIST_GATE_STATE_SESSION_KEY) return } - localStorage.setItem(HOST_LIST_GATE_STATE_KEY, String(value)) + sessionStorage.setItem(HOST_LIST_GATE_STATE_SESSION_KEY, String(value)) } catch (e) { console.error('[HostListDialog] 保存门控状态失败:', e) }