diff --git a/src/components/Index.vue b/src/components/Index.vue index 17de985..b28c3b0 100644 --- a/src/components/Index.vue +++ b/src/components/Index.vue @@ -453,6 +453,9 @@ const activityBtn = (item) => { console.log("牛牛杯"); window.location.href = "https://appstatic.cmschina.com/activity/cmszhyxpt/bees/index.html?id=INT_SMKTC_uD5KUL2d"; + // setTimeout(()=>{ + // location.replace(location.href) + // },1000) } if (item.id == 5) { diff --git a/src/page/Home/Home.vue b/src/page/Home/Home.vue index 4eb1e41..dafd7ab 100644 --- a/src/page/Home/Home.vue +++ b/src/page/Home/Home.vue @@ -211,24 +211,25 @@ onBeforeMount(() => { 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("openid")){ - console.log("存在openid"); - apiAll(); - }else{ - console.log("不存在openid"); - getCode2(); + if (h5plugin.getQueryString("code")) { + // 存在code的话去换取openid + authCode.value = h5plugin.getQueryString("code"); + getOpenId(authCode.value); + } else { + getCode(); } + // 一步授权 + // if(h5plugin.getQueryString("openid")){ + // console.log("存在openid"); + // apiAll(); + // }else{ + // console.log("不存在openid"); + // getCode2(); + // } + + } }); diff --git a/src/store/index.js b/src/store/index.js index 2f47282..61fd32c 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -8,7 +8,8 @@ export default createStore({ state: { userAccount: { // xglOpenId: 'o9B_fvjtyh2KELQYc2t9A3MEh7JQ', //用户openid - xglOpenId: h5plugin.getQueryString('openid'), //用户openid + xglOpenId: '', //用户openid + // xglOpenId: h5plugin.getQueryString('openid'), //用户openid token: h5plugin.getQueryString('token'), //用户token cardId: h5plugin.getQueryString('cardId'), //carid nkh: '', //牛卡号