变更autotk为webai权限判断
This commit is contained in:
@@ -278,7 +278,8 @@ const emit = defineEmits(['close', 'save'])
|
|||||||
const { controlCheckTask } = usePythonBridge()
|
const { controlCheckTask } = usePythonBridge()
|
||||||
|
|
||||||
const HOST_LIST_MIN_COUNT_KEY = 'host_list_dialog_min_count'
|
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
|
const HOST_LIST_MONITOR_INTERVAL_MS = 30000
|
||||||
|
|
||||||
// Level Options
|
// Level Options
|
||||||
@@ -342,7 +343,7 @@ let hostListMonitorTimer = null
|
|||||||
|
|
||||||
const resolveRestrictedMaxAnchorCount = (fallbackValue = 9999999) => {
|
const resolveRestrictedMaxAnchorCount = (fallbackValue = 9999999) => {
|
||||||
const permissions = getPermissions()
|
const permissions = getPermissions()
|
||||||
return permissions?.autotk === 1 ? fallbackValue : 0
|
return permissions?.webAi === 1 ? fallbackValue : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加主播弹窗状态
|
// 添加主播弹窗状态
|
||||||
@@ -508,8 +509,8 @@ const stopHostListMonitor = () => {
|
|||||||
|
|
||||||
const loadLocalGateConfig = () => {
|
const loadLocalGateConfig = () => {
|
||||||
try {
|
try {
|
||||||
gateEnabled.value = false
|
const savedGateEnabled = sessionStorage.getItem(HOST_LIST_GATE_ENABLED_SESSION_KEY)
|
||||||
localStorage.removeItem(HOST_LIST_GATE_ENABLED_KEY)
|
gateEnabled.value = savedGateEnabled === 'true'
|
||||||
|
|
||||||
const savedMinCount = localStorage.getItem(HOST_LIST_MIN_COUNT_KEY)
|
const savedMinCount = localStorage.getItem(HOST_LIST_MIN_COUNT_KEY)
|
||||||
if (savedMinCount !== null && savedMinCount !== '') {
|
if (savedMinCount !== null && savedMinCount !== '') {
|
||||||
@@ -519,8 +520,14 @@ const loadLocalGateConfig = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkTaskGateState.value = null
|
const savedGateState = sessionStorage.getItem(HOST_LIST_GATE_STATE_SESSION_KEY)
|
||||||
localStorage.removeItem(HOST_LIST_GATE_STATE_KEY)
|
if (savedGateState === 'true') {
|
||||||
|
checkTaskGateState.value = true
|
||||||
|
} else if (savedGateState === 'false') {
|
||||||
|
checkTaskGateState.value = false
|
||||||
|
} else {
|
||||||
|
checkTaskGateState.value = null
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('[HostListDialog] 读取本地门控配置失败:', e)
|
console.error('[HostListDialog] 读取本地门控配置失败:', e)
|
||||||
}
|
}
|
||||||
@@ -528,7 +535,7 @@ const loadLocalGateConfig = () => {
|
|||||||
|
|
||||||
const persistGateEnabled = () => {
|
const persistGateEnabled = () => {
|
||||||
try {
|
try {
|
||||||
localStorage.setItem(HOST_LIST_GATE_ENABLED_KEY, String(gateEnabled.value))
|
sessionStorage.setItem(HOST_LIST_GATE_ENABLED_SESSION_KEY, String(gateEnabled.value))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('[HostListDialog] 保存上下限模式失败:', e)
|
console.error('[HostListDialog] 保存上下限模式失败:', e)
|
||||||
}
|
}
|
||||||
@@ -550,11 +557,11 @@ const persistMinCount = () => {
|
|||||||
const persistGateState = (value) => {
|
const persistGateState = (value) => {
|
||||||
try {
|
try {
|
||||||
if (value === null || value === undefined) {
|
if (value === null || value === undefined) {
|
||||||
localStorage.removeItem(HOST_LIST_GATE_STATE_KEY)
|
sessionStorage.removeItem(HOST_LIST_GATE_STATE_SESSION_KEY)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
localStorage.setItem(HOST_LIST_GATE_STATE_KEY, String(value))
|
sessionStorage.setItem(HOST_LIST_GATE_STATE_SESSION_KEY, String(value))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('[HostListDialog] 保存门控状态失败:', e)
|
console.error('[HostListDialog] 保存门控状态失败:', e)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user