From cefb187759fdcfd3cb6179b88d162c07a7840bdd Mon Sep 17 00:00:00 2001 From: JinxChen <2183691628@qq.com> Date: Sat, 8 Apr 2023 22:05:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20token=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E8=8E=B7=E5=8F=96token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/package-list/index.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/views/package-list/index.vue b/src/views/package-list/index.vue index c0f0280..6225d88 100644 --- a/src/views/package-list/index.vue +++ b/src/views/package-list/index.vue @@ -1,7 +1,7 @@ @@ -140,7 +140,8 @@ export default { payProductId: null, //套餐id packageIssue: null, //套餐分期 payType: '1', //支付方式 1 微信, 2 支付宝,支付宝又分为花呗和全额支付,全额支付分期数传0 或者1 ,花呗则传 3 6 12 - openId: '' + openId: '', + code: '' }; }, created() { @@ -161,6 +162,10 @@ export default { if(data.code === 20000) { this.openId = data.data.openId; this.$store.commit("openId", data.data.openId); + } else if (data.state === false) { + console.log("token过期"); + this.getToken(); + this.getOpenId(this.code); } }) }, @@ -188,6 +193,7 @@ export default { console.log("url", url); if (isNotNull(url) ||window.location.href.indexOf("code") > -1) { let code = url.split("&")[0]; + this.code = code; if (isNotNull(code)) { this.getOpenId(code); } else {