修复一些前端问题

This commit is contained in:
xiaowang
2026-03-05 16:28:05 +08:00
parent 6cbd3bc076
commit 191c558049
6 changed files with 37 additions and 40 deletions
+5 -3
View File
@@ -68,8 +68,8 @@ const handleBackClick = () => {
const fetchWishlist = async () => {
try {
const response = await wishlistApi.getWishlist()
wishlistItems.value = response
await loadImageUrls(response)
wishlistItems.value = response as WishlistItem[]
await loadImageUrls(response as WishlistItem[])
} catch (error) {
console.error('获取收藏列表失败:', error)
ElMessage.error('获取收藏列表失败')
@@ -89,7 +89,9 @@ const loadImageUrls = async (items: WishlistItem[]) => {
const response = await fileApi.getSignedUrl(Number(id)) as any
imageIdCache.value[id] = response
}
urls.push(imageIdCache.value[id])
if (imageIdCache.value[id]) {
urls.push(imageIdCache.value[id] as string)
}
} catch (error) {
console.error('获取签名链接失败:', error)
urls.push(DEFAULT_PRODUCT_IMAGE)