修复前端打包问题

提取基础接口为配置
This commit is contained in:
xiaowang
2026-03-10 23:23:15 +08:00
parent 191c558049
commit 580a89c64d
27 changed files with 257 additions and 222 deletions
+10 -9
View File
@@ -188,19 +188,20 @@ const loadBannerImages = async () => {
const fileIdPromises: Promise<string>[] = []
// 从店铺获取图片
const shops = await shopApi.getAllShops() as ShopVO[]
const shops = await shopApi.getAllShops() as unknown as ShopVO[]
// 处理店铺图片 - 只使用coverImageFileId(banner图片)
for (const shop of shops) {
// 处理coverImageFileId(专门用于banner的图片)
if (shop.coverImageFileId) {
const fileIds = shop.coverImageFileId.split(',').filter(id => id.trim())
const shopAny = shop as any
if (shopAny.coverImageFileId) {
const fileIds = shopAny.coverImageFileId.split(',').filter((id: string) => id.trim())
for (const idStr of fileIds) {
const fileId = parseInt(idStr)
if (!isNaN(fileId)) {
const promise = fileApi.getSignedUrl(fileId).catch(err => {
const promise = fileApi.getSignedUrl(fileId).then((response: any) => response as string).catch(err => {
console.error('获取店铺banner图签名失败:', err)
return null
return ''
})
fileIdPromises.push(promise)
}
@@ -211,8 +212,8 @@ const loadBannerImages = async () => {
// 并行请求所有签名URL
const results = await Promise.all(fileIdPromises)
// 过滤掉null值并去除反引号
const filteredResults = results.filter((url): url is string => url !== null).map(url => url.replace(/[`]/g, '').trim())
// 过滤掉空值并去除反引号
const filteredResults = results.filter((url): url is string => url !== '').map(url => url.replace(/[`]/g, '').trim())
// 去重
const uniqueImages = [...new Set(filteredResults)]
@@ -328,7 +329,7 @@ const handleNotificationClick = () => {
}
// 处理搜索输入
const handleSearch = (e: any) => {
const handleSearch = (_e: any) => {
}
// 处理筛选按钮点击
@@ -340,7 +341,7 @@ const handleBannerClick = () => {
}
// 处理查看全部点击
const handleSeeAll = (type: string) => {
const handleSeeAll = (_type: string) => {
router.push('/products')
}