公众号登录完成
This commit is contained in:
@@ -205,6 +205,7 @@ let timer = {}
|
|||||||
const oauth2Weixin = params => {
|
const oauth2Weixin = params => {
|
||||||
const redirect = qs.parseUrl(location.href)
|
const redirect = qs.parseUrl(location.href)
|
||||||
delete redirect.query.code
|
delete redirect.query.code
|
||||||
|
delete redirect.query.state
|
||||||
return qs.stringifyUrl({
|
return qs.stringifyUrl({
|
||||||
url: "https://open.weixin.qq.com/connect/oauth2/authorize",
|
url: "https://open.weixin.qq.com/connect/oauth2/authorize",
|
||||||
query: {
|
query: {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export default {
|
|||||||
appName: "投票详情",
|
appName: "投票详情",
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user']),
|
...mapState(['user']),
|
||||||
|
wxCode: v => v.$route.query.code
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -42,12 +43,15 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {//已登录,直接投票
|
} else {//已登录,直接投票
|
||||||
|
console.log("投票")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getDetail()
|
this.getDetail()
|
||||||
|
if (!!this.wxCode) {
|
||||||
|
this.getWechatToken({module: "AppVote", code: this.wxCode}).then(this.handleVote)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user