优化websocket连接

This commit is contained in:
2026-04-24 15:25:15 +08:00
parent 2ce128e63a
commit 203e478b65
6 changed files with 47 additions and 2 deletions

View File

@@ -305,6 +305,14 @@ function handleWsPayload(raw: unknown): void {
mergeLiveSnapshot(parsed.data as anyObj)
return
}
if (event === 'jackpot.hit' && parsed.data && typeof parsed.data === 'object') {
const jackpotData = parsed.data as anyObj
const hits = Array.isArray(jackpotData.hits) ? jackpotData.hits : []
if (hits.length > 0) {
ElMessage.success(t('game.live.jackpot_hit_tip'))
}
return
}
if (event === 'period.tick' && parsed.data && typeof parsed.data === 'object') {
const periodData = parsed.data as anyObj
if (typeof periodData.server_time === 'number') {