From a929cfedb426349864cdfd1ff1576d75666e5adc Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Fri, 29 May 2026 14:13:04 +0800 Subject: [PATCH] fix(js/list): add response code check for merch info request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化商家信息接口请求的响应处理,增加返回码和数据有效性校验,避免异常数据赋值 --- pages_promotion/merch/public/js/list.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pages_promotion/merch/public/js/list.js b/pages_promotion/merch/public/js/list.js index 40fda9c..0d2c625 100644 --- a/pages_promotion/merch/public/js/list.js +++ b/pages_promotion/merch/public/js/list.js @@ -144,16 +144,18 @@ export default { }; }, methods: { - getMerch(){ - this.$api.sendRequest({ - url: '/merch/api/merch/merchinfo', - data: { - merch_id:this.merch_id - }, - success: res => { - this.merch = res.data - } - }); + getMerch(){ + this.$api.sendRequest({ + url: '/merch/api/merch/merchinfo', + data: { + merch_id: this.merch_id + }, + success: res => { + if (res.code >= 0 && res.data) { + this.merch = res.data; + } + } + }); }, /** * 获取优惠券数据