测试2
This commit is contained in:
parent
20c23c8f47
commit
5ecf23bfc2
@ -211,20 +211,23 @@ 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("code")) {
|
||||
// // 存在code的话去换取openid
|
||||
// authCode.value = h5plugin.getQueryString("code");
|
||||
// getOpenId(authCode.value);
|
||||
// } else {
|
||||
// getCode();
|
||||
// }
|
||||
|
||||
getCode2();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// 页面挂载
|
||||
onMounted(() => {
|
||||
fontAdpat();
|
||||
stopBack()
|
||||
// stopBack()
|
||||
});
|
||||
|
||||
// 来自首页的事件
|
||||
@ -233,6 +236,27 @@ const indexPage = (actions) => {
|
||||
};
|
||||
|
||||
// 授权获取code
|
||||
const getCode2 = () => {
|
||||
let redirect_uri = window.location.href;
|
||||
// service.post(process.env.VUE_APP_API + '/cms-activity/cms88/zsApi/xfhdAuthorize?redirect_uri='+redirect_uri,
|
||||
service
|
||||
.get(process.env.VUE_APP_API + "/cms-activity/cms88/zsApi/xfhdAuthorize1", {
|
||||
params:{
|
||||
redirect_uri: redirect_uri,
|
||||
|
||||
}
|
||||
})
|
||||
.then((res) => {
|
||||
let code = res.data.data;
|
||||
console.log("get code结果4", res);
|
||||
// authCode.value = res.data.data;
|
||||
// window.location.href = res.data.data;
|
||||
// location.href = res.data.data;
|
||||
// window.open(res.data.data)
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
const getCode = () => {
|
||||
let redirect_uri = window.location.href;
|
||||
// service.post(process.env.VUE_APP_API + '/cms-activity/cms88/zsApi/xfhdAuthorize?redirect_uri='+redirect_uri,
|
||||
@ -244,8 +268,8 @@ const getCode = () => {
|
||||
let code = res.data.data;
|
||||
console.log("get code结果3", res);
|
||||
authCode.value = res.data.data;
|
||||
// window.location.href = res.data.data;
|
||||
location.href = res.data.data;
|
||||
window.location.href = res.data.data;
|
||||
// location.href = res.data.data;
|
||||
// window.open(res.data.data)
|
||||
});
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user