This commit is contained in:
yixu
2025-09-22 17:36:39 +08:00
parent dbe781c402
commit 50e1dc2139
3 changed files with 8 additions and 92 deletions

View File

@@ -35,8 +35,9 @@ const fetchImages = async () => {
})
const data = await response.json()
if (response.status == 200 || response.status == 201) {
images.value = data.data;
const foundItem = data.data.find(item => item.is_public === true);
// 只保留result_url存在的记录
images.value = data.data.filter(item => item.result_url);
const foundItem = images.value.find(item => item.is_public === true);
if (foundItem) {
globalStore.result_url = foundItem.result_url;
globalStore.mergeId = foundItem.id
@@ -44,7 +45,7 @@ const fetchImages = async () => {
} else {
displayZhuli.value = false;
}
imageList.value = data;
imageList.value = images.value;
const hasPublicImage = images.value.some(item => item.is_public);
if (hasPublicImage) {