code验证
This commit is contained in:
parent
207c1f4d94
commit
61beec853f
@ -79,20 +79,21 @@ const indexPage = (actions) => {
|
|||||||
// 授权获取code
|
// 授权获取code
|
||||||
const getCode = () => {
|
const getCode = () => {
|
||||||
let redirect_uri = window.location.href;
|
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
|
redirect_uri: redirect_uri
|
||||||
|
|
||||||
})).then((res) => {
|
})).then((res) => {
|
||||||
let code = res.data.data
|
let code = res.data.data
|
||||||
authCode.value = res.data.data
|
console.log("get code",res);
|
||||||
window.location.href = res.data.data
|
// authCode.value = res.data.data
|
||||||
|
// window.location.href = res.data.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 授权获取openid
|
// 授权获取openid
|
||||||
const getOpenId = (code) => {
|
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
|
code: code
|
||||||
})).then((res) => {
|
})).then((res) => {
|
||||||
|
|
||||||
@ -100,10 +101,10 @@ const getOpenId = (code) => {
|
|||||||
console.log("后端返回的openid:", res.data);
|
console.log("后端返回的openid:", res.data);
|
||||||
// 更新openid
|
// 更新openid
|
||||||
store.commit({ type: 'updateXGLOpenid', openid: res.data.data })
|
store.commit({ type: 'updateXGLOpenid', openid: res.data.data })
|
||||||
store.commit({ type: "updateToken", token: h5plugin.getQueryString('token') });
|
// store.commit({ type: "updateToken", token: h5plugin.getQueryString('token') });
|
||||||
store.commit({ type: "updateCardId", cardId: h5plugin.getQueryString('cardId') });
|
// store.commit({ type: "updateCardId", cardId: h5plugin.getQueryString('cardId') });
|
||||||
store.commit({ type: "updateNkh", cardId: h5plugin.getQueryString('nkh') });
|
// store.commit({ type: "updateNkh", cardId: h5plugin.getQueryString('nkh') });
|
||||||
console.log("用户活动信息:", store.state.userAccount);
|
// console.log("用户活动信息:", store.state.userAccount);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user