接口初始调通

This commit is contained in:
tcubic
2022-08-02 16:57:47 +08:00
parent d419800cdc
commit 6cc6503270
5 changed files with 119 additions and 45 deletions

View File

@@ -38,34 +38,30 @@ onBeforeMount(() => {
console.log("link",window.location.href);
// 微信环境授权
// if (h5plugin.isWX()) {
// console.log('code:', h5plugin.getQueryString('code'));
if (h5plugin.isWX()) {
console.log('code:', h5plugin.getQueryString('code'));
if (h5plugin.getQueryString('code')) {
// 存在code的话去换取openid
authCode.value = h5plugin.getQueryString('code')
getOpenId(authCode.value)
} else {
getCode()
}
}
// if (h5plugin.getQueryString('code')) {
// // 存在code的话去换取openid
// authCode.value = h5plugin.getQueryString('code')
// getOpenId(authCode.value)
// } else {
// getCode()
// }
// }
// let token = h5plugin.getQueryString('token')
// 更新openid
store.commit({ type: "updateToken", token: h5plugin.getQueryString('token') });
store.commit({ type: "updateCardId", cardId: h5plugin.getQueryString('cardId') });
store.commit({ type: "updateNkh", cardId: h5plugin.getQueryString('nkh') });
console.log("用户活动信息:", store.state.userAccount);
});
// 页面挂载
onMounted(() => {