From 2095fc78e6ffc3d7310f2fdedfdc08adc9dc95c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=92?= Date: Fri, 31 Oct 2025 16:58:20 +0800 Subject: [PATCH] 1 --- src/views/system/giftcoupon/index.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/views/system/giftcoupon/index.vue b/src/views/system/giftcoupon/index.vue index 5d848cb..4522e29 100644 --- a/src/views/system/giftcoupon/index.vue +++ b/src/views/system/giftcoupon/index.vue @@ -781,8 +781,13 @@ export default { errorMsg = res.data.msg } // 如果是code:200但giftCouponKey为null的情况 - else if (res.code === 200 && res.data && res.data.giftCouponKey === null) { - errorMsg = '礼金创建失败:返回的礼金Key为null。可能的原因:\n1. 商品不支持创建礼金\n2. 商品类型(自营/POP)判断错误\n3. 京东API调用失败\n4. 商品已下架或不存在\n\n请检查:\n- 商品链接是否正确\n- 商品类型是否匹配(查询到的owner是否正确)\n- 查看JD项目日志获取详细错误信息' + else if (res.code === 200 && res.data && (res.data.giftCouponKey === null || res.data.giftCouponKey === undefined)) { + // 优先使用后端返回的错误信息 + if (res.data.msg) { + errorMsg = res.data.msg + } else { + errorMsg = '礼金创建失败:返回的礼金Key为null。可能的原因:\n1. 商品不支持创建礼金\n2. 商品类型(自营/POP)判断错误(当前为:' + this.createForm.owner + ')\n3. 京东API调用失败\n4. 商品已下架或不存在\n5. SKU ID或商品链接不正确\n\n请检查:\n- 商品链接是否正确\n- 商品类型是否匹配(查询到的owner是否正确)\n- 查看JD项目日志获取详细错误信息\n- 尝试重新查询商品信息' + } } // 其他错误情况 else if (res.message) {