From 59fee9df189135af71b9c1f2b6574fa210d59255 Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Sat, 12 Apr 2025 09:19:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?Conf(=E6=8B=A6=E6=88=AA=E5=99=A8):=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=99=BD=E5=90=8D=E5=8D=95=EF=BC=8C=E9=92=88=E5=AF=B9?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E8=BF=94=E5=9B=9E401=E4=B8=8D=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=88=B0=E7=99=BB=E5=BD=95=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/request.js | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/utils/request.js b/utils/request.js index a6d428b..4e3146d 100644 --- a/utils/request.js +++ b/utils/request.js @@ -63,7 +63,7 @@ const defaultOpt = {login: true}; function baseRequest(options) { // 从缓存中获取 token 防止 token 失效后还会继续请求的情况 - const token = cookie.get('login_status'); + const token = cookie.get('login_status') // 合并传参过来的 headers // 如果接口需要登录,携带 token 去请求 @@ -85,28 +85,39 @@ function baseRequest(options) { // 发起请求 return http[options.method](url, _params).then(res => { - const resData = res.data || {}; + const resData = res.data || {} // AI对话某个请求返回为空需要处理这种情况 if (['get', 'GET'].includes(options.method) && _params.params.isNoNeedPublicErrorNotification === 1) { console.log('----') if (resData.status === 500) { - return Promise.reject({msg: resData.msg, res, data}); + return Promise.reject({msg: resData.msg, res, data}) } else { return Promise.resolve({}) } } if (res.statusCode !== 200) { - return Promise.reject({msg: "请求失败", res, resData}); + return Promise.reject({msg: "请求失败", res, resData}) } if (resData.status === 401) { - handleLoginFailure(); - return Promise.reject({msg: '未登录', res, resData, toLogin: true}); + const whiteApiList = ['guide/status'] + let flag = false + whiteApiList.map(item => { + if (options.url.indexOf(item) > -1) { + flag = true + } + }) + if (flag) { + return Promise.resolve(resData, res) + } else { + handleLoginFailure(); + return Promise.reject({msg: '未登录', res, resData, toLogin: true}) + } } if ([ 403].indexOf(resData.status) !== -1) { handleLoginFailure(); - return Promise.reject({msg: res.data.msg, res, resData, toLogin: true}); + return Promise.reject({msg: res.data.msg, res, resData, toLogin: true}) } else if (resData.status === 200) { - return Promise.resolve(resData, res); + return Promise.resolve(resData, res) } else { // 埋点数据推送、获取店铺分享图片 if (url.indexOf('api/systemStats/push') < 0 && url.indexOf('api/hotelMain/shareImage') < 0) { @@ -118,9 +129,9 @@ function baseRequest(options) { } }) } - return Promise.reject({msg: resData.msg, res, data}); + return Promise.reject({msg: resData.msg, res, data}) } - }); + }) } /** From fdcdfc505f3f3d89b23681883c8df2af672ddb5c Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Mon, 14 Apr 2025 09:09:24 +0800 Subject: [PATCH 2/3] =?UTF-8?q?Conf(=E6=8B=A6=E6=88=AA=E5=99=A8):=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=99=BD=E5=90=8D=E5=8D=95=EF=BC=8C=E9=92=88=E5=AF=B9?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E8=BF=94=E5=9B=9E401=E4=B8=8D=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=88=B0=E7=99=BB=E5=BD=95=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/request.js b/utils/request.js index 4e3146d..6393792 100644 --- a/utils/request.js +++ b/utils/request.js @@ -99,7 +99,7 @@ function baseRequest(options) { return Promise.reject({msg: "请求失败", res, resData}) } if (resData.status === 401) { - const whiteApiList = ['guide/status'] + const whiteApiList = ['guide/status', 'cart/count', 'product/hasFavorite'] let flag = false whiteApiList.map(item => { if (options.url.indexOf(item) > -1) { From aa58754f1c2e679dade999b5da2610a19c7478be Mon Sep 17 00:00:00 2001 From: linxi Date: Mon, 14 Apr 2025 10:51:42 +0800 Subject: [PATCH 3/3] =?UTF-8?q?Fix=EF=BC=9A=E5=AE=A2=E6=9C=8D=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=95=86=E5=93=81=E5=B1=95=E7=A4=BA=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E9=9D=A2=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/shop/GoodsCon/index.vue | 5 +++-- pkg_common/views/room.vue | 10 ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pages/shop/GoodsCon/index.vue b/pages/shop/GoodsCon/index.vue index fb0e9be..63672a9 100644 --- a/pages/shop/GoodsCon/index.vue +++ b/pages/shop/GoodsCon/index.vue @@ -817,7 +817,7 @@ export default { }) }, goRoom() { - console.log(this.systemStore); + console.log(this.storeInfo); const params = { goodsId: this.id, goodsName: this.attr.productSelect.store_name, @@ -826,7 +826,8 @@ export default { seckillId: this.activityId, cover: this.attr.productSelect.image, goodsData: '', - seckillData: '' + seckillData: '', + isNegotiable: this.storeInfo.isNegotiable } const name = this.storeInfo.merName uni.navigateTo({ diff --git a/pkg_common/views/room.vue b/pkg_common/views/room.vue index ec6df9a..95d81ee 100644 --- a/pkg_common/views/room.vue +++ b/pkg_common/views/room.vue @@ -37,9 +37,12 @@ {{ wsJson(item.msg_content).skuStr }} - + ¥{{ wsJson(item.msg_content).price }} + + 价格面议 + @@ -60,9 +63,12 @@ {{ params.skuStr }} - + ¥{{ params.price }} + + 价格面议 +