code验证

This commit is contained in:
tcubic 2022-08-02 18:39:48 +08:00
parent 207c1f4d94
commit 61beec853f

View File

@ -79,20 +79,21 @@ const indexPage = (actions) => {
// code
const getCode = () => {
let redirect_uri = window.location.href;
service.post(process.env.VUE_APP_API + '/zsApi/xfhdAuthorize', qs.stringify({
service.post(process.env.VUE_APP_API + '/cms-activity/cms88/zsApi/xfhdAuthorize', qs.stringify({
redirect_uri: redirect_uri
})).then((res) => {
let code = res.data.data
authCode.value = res.data.data
window.location.href = res.data.data
console.log("get code",res);
// authCode.value = res.data.data
// window.location.href = res.data.data
})
}
// openid
const getOpenId = (code) => {
service.post(process.env.VUE_APP_API + '/zsApi/oauthInfo', qs.stringify({
service.post(process.env.VUE_APP_API + '/cms-activity/cms88/zsApi/oauthInfo', qs.stringify({
code: code
})).then((res) => {
@ -100,10 +101,10 @@ const getOpenId = (code) => {
console.log("后端返回的openid", res.data);
// openid
store.commit({ type: 'updateXGLOpenid', openid: res.data.data })
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);
// 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);
}