添加登录默认配置
This commit is contained in:
@@ -257,6 +257,7 @@
|
||||
<script setup>
|
||||
import { ref, computed, watch, onMounted } from 'vue'
|
||||
import { isElectron } from '../utils/electronBridge'
|
||||
import { getPermissions } from '@/utils/storage'
|
||||
|
||||
const props = defineProps({
|
||||
visible: { type: Boolean, required: true }
|
||||
@@ -318,6 +319,11 @@ const maxCount = ref()
|
||||
const selectedLevels = ref(new Set())
|
||||
const showLevelDropdown = ref(false)
|
||||
|
||||
const resolveRestrictedMaxAnchorCount = (fallbackValue = 9999999) => {
|
||||
const permissions = getPermissions()
|
||||
return permissions?.autotk === 1 ? fallbackValue : 0
|
||||
}
|
||||
|
||||
// 添加主播弹窗状态
|
||||
const showAddDialog = ref(false)
|
||||
const addLoading = ref(false)
|
||||
@@ -398,6 +404,7 @@ watch(() => filters.value, async (newFilters) => {
|
||||
ordinary: newFilters.ordinary,
|
||||
minOnlineFans: newFilters.minOnlineFans ? parseInt(newFilters.minOnlineFans) : 0,
|
||||
maxOnlineFans: newFilters.maxOnlineFans ? parseInt(newFilters.maxOnlineFans) : 0,
|
||||
maxAnchorCount: resolveRestrictedMaxAnchorCount(maxCount.value || 9999999),
|
||||
}
|
||||
})
|
||||
console.log('[HostListDialog] 过滤配置已同步:', newFilters)
|
||||
@@ -531,7 +538,7 @@ const updateMaxCount = async (value) => {
|
||||
if (!isElectron()) return
|
||||
try {
|
||||
// 如果不填写,传 9999999 表示无限制
|
||||
const maxAnchorCount = value || 9999999
|
||||
const maxAnchorCount = resolveRestrictedMaxAnchorCount(value || 9999999)
|
||||
await window.electronAPI.updateAutomationConfig({
|
||||
filters: { maxAnchorCount }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user