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