|
|
@@ -1,7 +1,7 @@ |
|
|
|
<!-- |
|
|
|
* @Date: 2022-04-15 10:22:36 |
|
|
|
* @LastEditors: JinxChen |
|
|
|
* @LastEditTime: 2023-04-17 17:40:01 |
|
|
|
* @LastEditTime: 2023-10-30 10:04:00 |
|
|
|
* @FilePath: \TelpoH5FrontendWeb\src\views\card-info\index.vue |
|
|
|
* @description: |
|
|
|
--> |
|
|
@@ -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: '系统繁忙,请重新进入' |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|