修复一些问题,优化前后端交互接口格式,优化首页轮播图图的维护

This commit is contained in:
xiaowang
2026-03-04 10:14:45 +08:00
parent b0470b8f86
commit 769a736836
21 changed files with 832 additions and 246 deletions
+9 -3
View File
@@ -457,9 +457,15 @@ const fetchCoupons = async () => {
const currentUser = getCurrentUserInfo()
const shopId = (currentUser && currentUser.shopId) ? currentUser.shopId : undefined
const res = await adminCouponApi.listAllCoupons(shopId)
// 处理后端返回的分页数据结构
couponList.value = res?.list || []
pagination.total = res?.total || 0
// 后端返回的是数组,直接使用
if (Array.isArray(res)) {
couponList.value = res
pagination.total = res.length
} else {
// 兼容分页数据结构
couponList.value = res?.list || []
pagination.total = res?.total || 0
}
} catch (error) {
message.error('获取优惠券列表失败')
} finally {