feat: 新增激进抢购模式

- 添加 SeckillMode 类型(标准/激进)
- 激进模式:第一轮完整校验,后续复用 CSRF 直接兑换
- 每轮开始时清空缓存,强制重新获取 CSRF
- 设置面板添加模式切换
- 缓存 30 秒有效期,CSRF 错误时自动回退标准模式
This commit is contained in:
yml2213
2026-06-26 13:58:54 +08:00
parent 385a6d882c
commit 59bd34b004
6 changed files with 181 additions and 20 deletions
+5 -2
View File
@@ -14,6 +14,7 @@ export interface Settings {
concurrency: number
attempts: number
retryStages: RetryStage[]
seckillMode: number // 0=标准, 1=激进
}
const App = window.go.main.App
@@ -31,7 +32,8 @@ const settings = ref<Settings>({
logLevel: 'info',
concurrency: 80,
attempts: 1,
retryStages: [...defaultRetryStages]
retryStages: [...defaultRetryStages],
seckillMode: 0
})
export function useSettings() {
@@ -49,7 +51,8 @@ export function useSettings() {
attempts: cfg.attempts || 1,
retryStages: cfg.retryStages && cfg.retryStages.length > 0
? cfg.retryStages
: [...defaultRetryStages]
: [...defaultRetryStages],
seckillMode: cfg.seckillMode || 0
}
} catch (e: any) {
showToast('读取设置失败', e.message, 'error')