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 {