优化一些功能

This commit is contained in:
yml2213
2026-07-29 14:02:56 +08:00
parent 2c88edb741
commit f64838f8db
19 changed files with 313 additions and 85 deletions
+11 -8
View File
@@ -2,12 +2,15 @@
import { ref, computed } from 'vue'
import { useProducts } from '@/composables/useProducts'
import { useToast } from '@/composables/useToast'
import {
ExportAccountsWithProduct,
OrganizeAccounts,
VerifyAndExport
} from '@wails/go/app/App'
const { selectedProductId, selectedProductName, selectedProduct } = useProducts()
const { showToast } = useToast()
const App = window.go.app.App
// 状态
const loading = ref(false)
const verifyResult = ref<any>(null)
@@ -42,14 +45,14 @@ const handleVerify = async () => {
loading.value = true
try {
const result = await App.VerifyAndExport(selectedProductId.value)
const result = await VerifyAndExport(selectedProductId.value)
verifyResult.value = result
organizeResult.value = null
if (result.success) {
showToast('复验完成', `已抢到: ${result.hitCount}, 未抢到: ${result.missCount}`, 'success')
} else {
showToast('复验失败', result.error, 'error')
showToast('复验失败', '后端未返回成功状态', 'error')
}
} catch (e: any) {
showToast('复验失败', e.message, 'error')
@@ -66,7 +69,7 @@ const exportHitAccounts = async () => {
}
try {
const result = await App.ExportAccountsWithProduct(
const result = await ExportAccountsWithProduct(
verifyResult.value.hitAccounts,
selectedProductId.value,
selectedProductName.value || ''
@@ -74,7 +77,7 @@ const exportHitAccounts = async () => {
if (result.success) {
showToast('导出成功', `已导出 ${result.count} 个账号到 ${result.filePath}`, 'success')
} else {
showToast('导出失败', result.error, 'error')
showToast('导出失败', result.error || '', 'error')
}
} catch (e: any) {
showToast('导出失败', e.message, 'error')
@@ -91,14 +94,14 @@ const handleOrganize = async () => {
loading.value = true
try {
const { start, end } = timeRangeMs.value
const result = await App.OrganizeAccounts(selectedProductId.value, selectedProductName.value, start, end)
const result = await OrganizeAccounts(selectedProductId.value, selectedProductName.value, start, end)
organizeResult.value = result
verifyResult.value = null
if (result.success) {
showToast('整理完成', `已抢到: ${result.hitCount}, 未抢到: ${result.missCount}`, 'success')
} else {
showToast('整理失败', result.error, 'error')
showToast('整理失败', result.error || '', 'error')
}
} catch (e: any) {
showToast('整理失败', e.message, 'error')
@@ -7,11 +7,12 @@ const { settings, loadSettings, saveSettings } = useSettings()
const visible = ref(false)
const formData = ref({
timeApiUrl: '',
activity: '',
traceEnabled: false,
traceMaxBody: 0,
logLevel: 'info',
concurrency: 150,
attempts: 1,
attempts: 2,
retryStages: [] as RetryStage[],
seckillMode: 1
})