This commit is contained in:
tcubic 2022-08-08 13:54:39 +08:00
parent 20c23c8f47
commit 5ecf23bfc2

View File

@ -211,20 +211,23 @@ onBeforeMount(() => {
if (h5plugin.isWX()) {
console.log("code:", h5plugin.getQueryString("code"));
if (h5plugin.getQueryString("code")) {
// codeopenid
authCode.value = h5plugin.getQueryString("code");
getOpenId(authCode.value);
} else {
getCode();
}
// if (h5plugin.getQueryString("code")) {
// // codeopenid
// 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)
});
};