From c252be49860f0050765fdb97d95e27b098cd60d8 Mon Sep 17 00:00:00 2001 From: JinxChen <2183691628@qq.com> Date: Sat, 8 Apr 2023 16:53:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=20=20=E8=8E=B7=E5=8F=96token?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/package-home/index.vue | 4 ++-- src/views/package-list/index.vue | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) 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);