优化一些功能
This commit is contained in:
@@ -3,8 +3,7 @@ import { useToast } from './useToast'
|
||||
import { useAccounts } from './useAccounts'
|
||||
import { useProducts } from './useProducts'
|
||||
import { useLogs } from './useLogs'
|
||||
|
||||
const App = window.go.app.App
|
||||
import { CancelSchedule, SetSchedule, StartSeckill } from '@wails/go/app/App'
|
||||
|
||||
const scheduleActive = ref(false)
|
||||
const countdownSeconds = ref(0)
|
||||
@@ -33,7 +32,7 @@ export function useScheduler() {
|
||||
showToast('抢购中', `${Object.keys(ap).length} 个账号正在抢购`, 'info', 3000)
|
||||
|
||||
try {
|
||||
const d = await App.StartSeckill(ap)
|
||||
const d = await StartSeckill(ap)
|
||||
if (d?.success === false) {
|
||||
throw new Error(d.error || '提交失败')
|
||||
}
|
||||
@@ -75,12 +74,12 @@ export function useScheduler() {
|
||||
addLocalLog(`设置定时: ${fullTime}`, 'i')
|
||||
|
||||
try {
|
||||
const d = await App.SetSchedule({
|
||||
const d = await SetSchedule({
|
||||
accountProducts: ap,
|
||||
targetTime: fullTime
|
||||
})
|
||||
if (d?.success === false) {
|
||||
throw new Error(d.error || '定时设置失败')
|
||||
throw new Error('定时设置失败')
|
||||
}
|
||||
|
||||
scheduleActive.value = true
|
||||
@@ -106,7 +105,7 @@ export function useScheduler() {
|
||||
|
||||
const cancelSchedule = async () => {
|
||||
try {
|
||||
await App.CancelSchedule()
|
||||
await CancelSchedule()
|
||||
} catch {}
|
||||
|
||||
scheduleActive.value = false
|
||||
|
||||
Reference in New Issue
Block a user