From 7331cb3959019bd329de4cb0bc0c70b7fcc0bb6d Mon Sep 17 00:00:00 2001 From: JinxChen <2183691628@qq.com> Date: Mon, 30 Oct 2023 10:08:10 +0800 Subject: [PATCH] =?UTF-8?q?fix=20-=20=E8=AF=9D=E8=B4=B9=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=20=20=20=20=20-=20=E4=BF=AE=E5=A4=8D=20token=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E6=97=B6=E5=AF=BC=E8=87=B4=E8=8E=B7=E5=8F=96openId=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=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 | 11 +++++++++-- src/config/models.js | 4 ++-- src/views/card-info/index.vue | 29 +++++++++++++++++++---------- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 5dd31a0..fb71320 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ @@ -747,4 +747,11 @@ update `2023.10.27` fix - c1后台设备功耗查看页面 - - 修复 上报周期无数据时显示不全的问题 \ No newline at end of file + - 修复 上报周期无数据时显示不全的问题 + + +## v1.0.94 +`2023.10.30` +fix +- 话费查询 + - 修复 token过期时导致获取openId失败的问题 diff --git a/src/config/models.js b/src/config/models.js index a8c5847..df192ec 100644 --- a/src/config/models.js +++ b/src/config/models.js @@ -1,11 +1,11 @@ /* * @Date: 2021-11-20 10:26:39 * @LastEditors: JinxChen - * @LastEditTime: 2023-10-16 09:34:24 + * @LastEditTime: 2023-10-30 10:07:56 * @FilePath: \TelpoH5FrontendWeb\src\config\models.js * @description: */ -export const VERSION_MODEL = '1.0.93F'; //版本号 +export const VERSION_MODEL = '1.0.94F'; //版本号 export const IMAGE_URL = { production: 'http://zfb.ssjlai.com/web/', test: 'http://zfb.ssjlai.com/web/', diff --git a/src/views/card-info/index.vue b/src/views/card-info/index.vue index 8f13f82..3fe6e41 100644 --- a/src/views/card-info/index.vue +++ b/src/views/card-info/index.vue @@ -1,7 +1,7 @@ @@ -95,6 +95,7 @@ export default { isShowMenu: this.$route.query.isShowMenu, params: {}, isShowPage: false, //是否显示整个页面 + code: '', //微信授权code } }, computed: { @@ -125,13 +126,14 @@ export default { // 获取token getToken() { let manufacturerNo = '9f166b07-ff83-4991-84dc-ca6ad4a6b95b'; - APIPay.getToken(manufacturerNo).then(res => { - console.log("token的数据", res.data) - let data = res.data; - if(data.code === 20000) { - this.$store.commit("token", data.token); - console.log("token的数据", localStorage.getItem('token')) - } + return new Promise((resolve) => { + APIPay.getToken(manufacturerNo).then(res => { + let data = res.data; + if(data.code === 20000) { + this.$store.commit("token", data.token); + resolve(true); + } + }); }) }, // 获取url传过来的参数 @@ -143,6 +145,7 @@ export default { if ( isNotNull(url) || window.location.href.indexOf("code") > -1) { let timeStamp = new Date().getTime(); let code = url.split("&")[0]; + this.code = code; if (isNotNull(code)) { this.isShowPage = true; if(!params.isHasCode) { @@ -174,8 +177,14 @@ export default { this.$store.commit("openId", data.data.openId); }else if (data.state === false) { console.log("token过期"); - this.getToken(); - this.getOpenId(this.code); + let hasToken = this.getToken(); + if(hasToken) { + this.getOpenId(this.code); + } else { + this.$dialog({ + message: '系统繁忙,请重新进入' + }) + } } }) },