2.4.9
This commit is contained in:
28
src/App.vue
28
src/App.vue
@@ -26,6 +26,14 @@
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<!-- 关闭中加载遮罩 -->
|
||||
<div v-if="isClosing" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
|
||||
<div class="bg-white rounded-lg p-8 flex flex-col items-center">
|
||||
<div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mb-4"></div>
|
||||
<p class="text-lg font-medium text-gray-800">关闭中,请稍候...</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -48,6 +56,7 @@ const CONFIG_KEY = 'autoDm_runConfig'
|
||||
const updateReady = ref(false)
|
||||
const currentPage = ref('login')
|
||||
const isLoading = ref(false)
|
||||
const isClosing = ref(false)
|
||||
const automationStatus = ref({})
|
||||
const accountGroups = ref([])
|
||||
const viewAccountMap = ref({})
|
||||
@@ -90,6 +99,25 @@ onMounted(() => {
|
||||
localStorage.removeItem(USER_KEY)
|
||||
})
|
||||
|
||||
// 应用关闭事件
|
||||
window.electronAPI.onAppClosingStart(async () => {
|
||||
console.log('[App] 收到应用关闭开始事件')
|
||||
isClosing.value = true
|
||||
// 隐藏所有视图,避免遮罩被视图盖住
|
||||
if (isElectron()) {
|
||||
window.electronAPI.hideViews().catch((e) => {
|
||||
console.warn('[App] 隐藏视图失败:', e)
|
||||
})
|
||||
|
||||
await handleStopAll()
|
||||
}
|
||||
})
|
||||
|
||||
window.electronAPI.onAppClosingComplete(() => {
|
||||
console.log('[App] 收到应用关闭完成事件')
|
||||
isClosing.value = false
|
||||
})
|
||||
|
||||
// Rotation Status
|
||||
window.electronAPI.getRotationStatus().then(status => {
|
||||
rotationStatus.value = status
|
||||
|
||||
@@ -384,7 +384,7 @@ const defaultConfig = {
|
||||
prologueList: {},
|
||||
needTranslate: false,
|
||||
filters: {
|
||||
maxAnchorCount: 100
|
||||
maxAnchorCount: 99999
|
||||
},
|
||||
lang: 'en'
|
||||
}
|
||||
@@ -705,7 +705,7 @@ const handleStart = async (specificGroupIndex) => {
|
||||
prologueList,
|
||||
needTranslate: config.value.needTranslate, // 添加翻译开关配置
|
||||
filters: {
|
||||
maxAnchorCount: config.value.filters?.maxAnchorCount || 100
|
||||
maxAnchorCount: config.value.filters?.maxAnchorCount !== undefined ? config.value.filters.maxAnchorCount : 100
|
||||
},
|
||||
rotationEnabled: config.value.rotateEnabled,
|
||||
rotationIntervalMinutes: config.value.switchMinutes,
|
||||
|
||||
2
src/types/electron.d.ts
vendored
2
src/types/electron.d.ts
vendored
@@ -145,6 +145,8 @@ export interface ElectronAPI {
|
||||
onRotationStatusChanged: (callback: (status: RotationStatus) => void) => () => void
|
||||
onRequestSaveConfig: (callback: () => void) => () => void
|
||||
onRequestClearLogin: (callback: () => void) => () => void
|
||||
onAppClosingStart: (callback: () => void) => () => void
|
||||
onAppClosingComplete: (callback: () => void) => () => void
|
||||
onUpdateChecking: (callback: () => void) => () => void
|
||||
onUpdateAvailable: (callback: (info: UpdateInfo) => void) => () => void
|
||||
onUpdateNotAvailable: (callback: () => void) => () => void
|
||||
|
||||
Reference in New Issue
Block a user