From f9a8716262443d9975ffdb2b4d847d8ae0badafc Mon Sep 17 00:00:00 2001 From: yixu Date: Tue, 30 Sep 2025 21:04:01 +0800 Subject: [PATCH] update --- src/components/Lottery.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/Lottery.vue b/src/components/Lottery.vue index 3e19a1d..73c2cd6 100644 --- a/src/components/Lottery.vue +++ b/src/components/Lottery.vue @@ -120,10 +120,17 @@ watch(() => props.show, async (newVal) => { let lottteryResult = null if (props.type === 'draw') { lottteryResult = await Request("lottery/draw", { pool: 'game', consume_type: 'points' }) + // 监听请求失败,关闭组件 + if (!lottteryResult || !lottteryResult.res || (lottteryResult.res.status !== 200 && lottteryResult.res.status !== 201)) { + emit('close') + loading.hide() + return + } } else { if (!props.data) { weui.alert("获取排名奖励出错,请刷新页面重试") emit('close') + loading.hide() return }