diff --git a/src/views/package-home/index.vue b/src/views/package-home/index.vue index a0608ae..e03a37e 100644 --- a/src/views/package-home/index.vue +++ b/src/views/package-home/index.vue @@ -1,7 +1,7 @@ @@ -26,7 +26,7 @@ export default { }; }, created() { - this.getToken(); + /* this.getToken(); */ this.getAuth(); this.checkImei(); this.getParams(); diff --git a/src/views/package-list/index.vue b/src/views/package-list/index.vue index e8bae71..dd31dc3 100644 --- a/src/views/package-list/index.vue +++ b/src/views/package-list/index.vue @@ -1,7 +1,7 @@ @@ -145,6 +145,7 @@ export default { }, created() { this.getAuth(); + this.getToken(); this.getParams(); this.getCode(); //this.getWxAutograph(); @@ -170,6 +171,18 @@ export default { this.$store.commit("gatewayToken", res.data.data); }); }, + // 获取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')) + } + }) + }, getCode() { let url = window.location.href.split("?code=")[1]; console.log("url", url);