From 6cc707cc2ec53eeff343b97a4b35559306c09a48 Mon Sep 17 00:00:00 2001 From: yixu Date: Thu, 18 Sep 2025 22:18:04 +0800 Subject: [PATCH] fix --- src/components/TodoList.vue | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/components/TodoList.vue b/src/components/TodoList.vue index 0a2378c..ad8d941 100644 --- a/src/components/TodoList.vue +++ b/src/components/TodoList.vue @@ -129,33 +129,36 @@ const openHaibao = async (e) => { url.searchParams.append('my_only', '1'); url.searchParams.append('page', '1'); url.searchParams.append('per_page', '100'); - if (!globalStore.result_url) { + if (!globalStore.result_url && !mergeId) { fetch(url.toString(), { method: 'GET', headers: { 'Authorization': `Bearer ${Storage.get("userinfos").api_token}` } }) - .then(response => response.json()) - .then(data => { - const foundItem = data.data.find(item => item.is_public === true); - if (foundItem) { - globalStore.result_url = foundItem.result_url; - mergeId = foundItem.id; - haibaoShow.value = true + .then(async response => { + const data = await response.json() + if (response.status == 200 || response.status == 201) { + const foundItem = data.data.find(item => item.is_public === true); + if (foundItem) { + globalStore.result_url = foundItem.result_url; + mergeId = foundItem.id; + haibaoShow.value = true - if (!globalStore.first_share_today) { - Request(`face/share/${mergeId}`) + if (!globalStore.first_share_today) { + Request(`face/share/${mergeId}`) + } + + handleHaibao() + } else { + return weui.alert("请先参与活动合成图片并打榜!") } - - handleHaibao() + return { success: true, data }; } else { - return weui.alert("请先参与活动合成图片并打榜!") + ElMessage.error(data.message); } - return { success: true, data }; }) .catch((error) => { - console.error('Error:', error); return { success: false, error }; }); } else {