fix: 修复游客购物车商品显示和添加地址问题
Build and Push Docker Image / build-and-push (push) Successful in 1m5s
Build and Push Docker Image / deploy (push) Successful in 7s

- ProductDetail.vue: 添加购物车时传入完整商品信息
- Cart.vue: 未登录点击添加地址跳转登录页
- 游客购物车正确显示商品状态
This commit is contained in:
2026-07-13 03:55:59 +00:00
parent 0c9cf4d347
commit 51edee4d92
2 changed files with 14 additions and 3 deletions
+2 -1
View File
@@ -124,7 +124,8 @@ async function addToCart() {
}
try {
await cartStore.addItem(product.value.id, quantity.value)
// 传入商品信息,支持游客购物车显示
await cartStore.addItem(product.value.id, quantity.value, product.value)
ElMessage.success(t('product.addToCart') + ' ✓')
} catch (err: any) {
// 处理后端返回的错误