From 4b01c7e5ce83aff520440e88853b309f3458a912 Mon Sep 17 00:00:00 2001 From: terwer Date: Wed, 11 Dec 2024 17:58:46 +0800 Subject: [PATCH] fix: #639 duplicate images in pic list --- packages/picgo-plugin-app/src/composables/usePicgoInitPage.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/picgo-plugin-app/src/composables/usePicgoInitPage.ts b/packages/picgo-plugin-app/src/composables/usePicgoInitPage.ts index 795bd80..65b6261 100644 --- a/packages/picgo-plugin-app/src/composables/usePicgoInitPage.ts +++ b/packages/picgo-plugin-app/src/composables/usePicgoInitPage.ts @@ -54,7 +54,8 @@ export const usePicgoInitPage = (props: any, deps: any) => { retImgs = retImgs.concat(retImgsWithBlockId) }) // 去重 - retImgs = [...new Set([...retImgs])] + // retImgs = [...new Set([...retImgs])] + retImgs = retImgs.filter((item, index, self) => index === self.findIndex((t) => t.url === item.url)) logger.debug("解析出来的所有的图片地址=>", retImgs) // 将字符串数组格式的图片信息转换成图片对象数组