From e621e99ccae998b16f46e26a51349b58899a182e Mon Sep 17 00:00:00 2001 From: JinxChen <2183691628@qq.com> Date: Thu, 6 Apr 2023 10:12:50 +0800 Subject: [PATCH] =?UTF-8?q?update=20-=20packageHome=20=20=20=20=20-=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=20appId=E8=8E=B7=E5=8F=96=E7=9A=84=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E6=9C=AC=E5=9C=B0=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=9B=BA=E5=AE=9A=E9=85=8D=E7=BD=AE=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E4=BB=8Eurl=E8=B7=AF=E7=94=B1=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +++++-- src/views/package-home/index.vue | 12 +++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 91e8d26..316cfa1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ @@ -336,4 +336,7 @@ update - appId - 修改 正式环境的appid - packageList - - 修改正式环境 代理商用户的userId \ No newline at end of file + - 修改 正式环境 代理商用户的userId + +- packageHome + - 修改 appId获取的方式,本地配置文件固定配置,不再从url路由获取 \ No newline at end of file diff --git a/src/views/package-home/index.vue b/src/views/package-home/index.vue index be85c8a..88468f5 100644 --- a/src/views/package-home/index.vue +++ b/src/views/package-home/index.vue @@ -1,7 +1,7 @@ @@ -16,6 +16,7 @@ import { APIPay } from "@/api/pay"; import APICore from "@/api/core"; import APIWx from "@/api/wx"; import { isNotNull } from "@/utils/index"; +import AppId from "@/config/appId"; export default { name: "", data() { @@ -108,9 +109,6 @@ export default { getWxCode() { let params = this.params; let commonUrl = process.env.VUE_APP_BASE_API; - /* let redUrl = encodeURIComponent(`${commonUrl}/h5-frontendweb/#/${params.routerName}?imei=${params.imei}&appId=${params.appId}&iccid=${params.iccid}`); - let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${params.appId}&redirect_uri=${redUrl}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`; - window.location.href = url; */ // todo 暂时去掉 if(this.isRecharge) { // 如果是已经支付,但未激活,跳转激活界面 @@ -122,8 +120,8 @@ export default { } }) } else { - let redUrl = encodeURIComponent(`${commonUrl}/h5-frontendweb/#/${params.routerName}?imei=${params.imei}&appId=${params.appId}&iccid=${params.iccid}`); - let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${params.appId}&redirect_uri=${redUrl}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`; + let redUrl = encodeURIComponent(`${commonUrl}/h5-frontendweb/#/${params.routerName}?imei=${params.imei}&appId=${AppId}&iccid=${params.iccid}`); + let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${AppId}&redirect_uri=${redUrl}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`; window.location.href = url; } @@ -134,7 +132,7 @@ export default { if (params) { console.log("params", params); this.params = {...params}; - this.$store.commit("appId", params.appId); + this.$store.commit("appId", AppId); if(params.reqUrl) { const reqUrl = encodeURI(params.reqUrl); console.log("reqUrl", params.reqUrl, reqUrl);