From 5173c7d42b5842763291efcc6b2dc7e60d2ecc19 Mon Sep 17 00:00:00 2001 From: JinxChen <2183691628@qq.com> Date: Sat, 25 Feb 2023 16:58:47 +0800 Subject: [PATCH] =?UTF-8?q?fix=20-=20=E4=BF=AE=E5=A4=8D=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96imei=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++-- src/views/package-home/index.vue | 4 ++-- src/views/package-list/index.vue | 25 +++++++++++++++---------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index d6d616d..173d5bb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ @@ -192,4 +192,5 @@ fix ## v1.0.20 `2023.2.25` fix -- 修复 调起微信支付异常的问题 \ No newline at end of file +- 修复 调起微信支付异常的问题 +- 修复 获取imei异常的问题 \ No newline at end of file diff --git a/src/views/package-home/index.vue b/src/views/package-home/index.vue index 87622d8..f341d25 100644 --- a/src/views/package-home/index.vue +++ b/src/views/package-home/index.vue @@ -1,7 +1,7 @@ @@ -46,7 +46,7 @@ export default { let timeStamp = new Date().getTime(); let code = url.split("&")[0]; if (isNotNull(code)) { - this.$store.commit("wxAuthCode", `${code}`); + this.$store.commit("wxAuthCode", code); /* this.getOpenId(); */ } } else { diff --git a/src/views/package-list/index.vue b/src/views/package-list/index.vue index 2d9e066..43cea5b 100644 --- a/src/views/package-list/index.vue +++ b/src/views/package-list/index.vue @@ -1,7 +1,7 @@ @@ -119,12 +119,17 @@ export default { // 根据code获取openId getOpenId() { let code = this.$store.getters.wxAuthCode; - APIPay.getOpenId(code).then(res => { - let data= res.data; - if(data.code === 20000) { - this.$store.commit("openId", data.data.openId); - } - }) + let openId = this.$store.getters.openId; + if(isNotNull(openId)) { + console.log("已经存在openId"); + } else { + APIPay.getOpenId(code).then(res => { + let data= res.data; + if(data.code === 20000) { + this.$store.commit("openId", data.data.openId); + } + }) + } }, // 获取b端接口的token getAuth() { @@ -298,7 +303,7 @@ export default { rechargeUrl: data.rechargeUrl, iccid: that.params.iccid, isAdmin: that.$route.query.isAdmin || false, - serialNo: that.$route.query.serialNo, + serialNo: that.params.imei, issue: data.packageIssue } }); @@ -367,9 +372,9 @@ export default { outTradeNo: that.outTradeNo, price: that.price, alipayForm: alipayForm, - iccid: that.$route.query.iccid, + iccid: that.params.iccid, isAdmin: that.$route.query.isAdmin || false, - serialNo: that.$route.query.serialNo, + serialNo: that.params.imei, alipayUserId: alipayUserId, productId: data.productId }