修复国家检测bug

This commit is contained in:
2026-02-09 21:04:09 +08:00
parent 658f50cc51
commit d59e4c0bb9
7 changed files with 419 additions and 71 deletions

View File

@@ -325,6 +325,34 @@
<!-- 打招呼内容弹窗 -->
<GreetingDialog :visible="showGreetingDialog" @close="showGreetingDialog = false" @confirm="handleGreetingConfirm" />
<!-- 预热 Loading 遮罩 -->
<transition name="fade">
<div v-if="warmingUp"
class="fixed inset-0 z-[9999] flex items-center justify-center bg-black/30 backdrop-blur-sm">
<div
class="bg-white/90 rounded-2xl shadow-2xl border border-white/60 px-6 py-5 flex items-center gap-4">
<!-- spinner -->
<div class="w-10 h-10 rounded-full border-4 border-gray-200 border-t-blue-500 animate-spin"></div>
<div class="space-y-1">
<div class="text-sm font-semibold text-gray-900">正在预热视图</div>
<div class="text-xs text-gray-500">
这会提升后台视图渲染稳定性请稍候
</div>
<!-- 可选进度小点点动画 -->
<div class="flex gap-1 pt-1">
<span
class="w-1.5 h-1.5 rounded-full bg-blue-400 animate-bounce [animation-delay:-0.2s]"></span>
<span
class="w-1.5 h-1.5 rounded-full bg-blue-400 animate-bounce [animation-delay:-0.1s]"></span>
<span class="w-1.5 h-1.5 rounded-full bg-blue-400 animate-bounce"></span>
</div>
</div>
</div>
</div>
</transition>
</div>
</template>
@@ -635,7 +663,7 @@ const handleSleepTimeInput = (val) => {
config.value.sleepTime = parseInt(val) || 0
}
}
const warmingUp = ref(false)
// Start/Stop
const handleStart = async (specificGroupIndex) => {
const activeGroupIndex = specificGroupIndex ?? 0
@@ -710,7 +738,8 @@ const handleStart = async (specificGroupIndex) => {
}
}
// 预热所有视图,确保后台视图完成渲染,解决自动化执行失败问题
// 预热所有视图,确保后台视图完成渲染,解决自动化执行失败问题
warmingUp.value = true
try {
console.log('[ConfigPage] 预热所有视图...')
await window.electronAPI.warmUpViews()
@@ -758,6 +787,7 @@ const handleStart = async (specificGroupIndex) => {
const status = await window.electronAPI.getRotationStatus()
rotationStatus.value = status
handleStatusChange(status)
warmingUp.value = false //关闭遮罩
emit('goToBrowser')
}
@@ -823,3 +853,14 @@ const togglePasswordVisibility = (gIndex, aIndex) => {
showPasswordMap.value[key] = !showPasswordMap.value[key]
}
</script>
<style scoped>
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.2s ease;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
</style>