变更autotk为webai权限判断

This commit is contained in:
2026-04-22 09:54:42 +08:00
parent 3d1e0ea9a3
commit 3b141e2060

View File

@@ -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)
}