Explorar el Código

调整 获取token的方式

feat
JinxChen hace 1 año
padre
commit
c252be4986
Se han modificado 2 ficheros con 16 adiciones y 3 borrados
  1. +2
    -2
      src/views/package-home/index.vue
  2. +14
    -1
      src/views/package-list/index.vue

+ 2
- 2
src/views/package-home/index.vue Ver fichero

@@ -1,7 +1,7 @@
<!--
* @Date: 2023-02-24 14:18:25
* @LastEditors: JinxChen
* @LastEditTime: 2023-04-08 16:35:10
* @LastEditTime: 2023-04-08 16:53:10
* @FilePath: \TelpoH5FrontendWeb\src\views\package-home\index.vue
* @description:
-->
@@ -26,7 +26,7 @@ export default {
};
},
created() {
this.getToken();
/* this.getToken(); */
this.getAuth();
this.checkImei();
this.getParams();


+ 14
- 1
src/views/package-list/index.vue Ver fichero

@@ -1,7 +1,7 @@
<!--
* @Date: 2022-03-29 16:57:58
* @LastEditors: JinxChen
* @LastEditTime: 2023-04-08 14:57:19
* @LastEditTime: 2023-04-08 16:52:36
* @FilePath: \TelpoH5FrontendWeb\src\views\package-list\index.vue
* @description: TODO 小台风充值h5
-->
@@ -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);


Cargando…
Cancelar
Guardar