Skip to content

Commit

Permalink
fix(SPA): 微信登录时获取不到access_token的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Nov 22, 2018
1 parent 72f3a6e commit b62940e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
2 changes: 0 additions & 2 deletions resources/spa/src/page/wechat/WechatBindUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ export default {
this.$store.dispatch('GET_UNREAD_COUNT')
this.$store.dispatch('GET_NEW_UNREAD_COUNT')
this.$store.commit('SAVE_USER', user)
this.$lstore.removeData('H5_WECHAT_MP_OPENID')
this.$lstore.removeData('H5_WECHAT_MP_ASTOKEN')
})
})
.finally(() => {
Expand Down
4 changes: 1 addition & 3 deletions resources/spa/src/page/wechat/WechatSignin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default {
this.$http
.post(
'socialite/wechat',
{ access_token: accessToken },
{ access_token: this.accessToken },
{ validateStatus: s => s === 201 || s === 404 }
)
.then(({ status, data: { token = '', user = {} } = {} }) => {
Expand All @@ -106,8 +106,6 @@ export default {
// 保存用户信息 并跳转
this.$router.push(this.$route.query.redirect || '/feeds?type=hot')
this.$nextTick(() => {
this.$lstore.removeData('H5_WECHAT_MP_OPENID')
this.$lstore.removeData('H5_WECHAT_MP_ASTOKEN')
this.$store.commit('SAVE_USER', user)
this.$store.dispatch('GET_UNREAD_COUNT')
this.$store.dispatch('GET_NEW_UNREAD_COUNT')
Expand Down
3 changes: 0 additions & 3 deletions resources/spa/src/page/wechat/WechatSignup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@ export default {
this.$store.dispatch('GET_UNREAD_COUNT')
this.$store.dispatch('GET_NEW_UNREAD_COUNT')
this.$store.commit('SAVE_USER', user)
this.$lstore.removeData('H5_WECHAT_MP_OPENID')
this.$lstore.removeData('H5_WECHAT_MP_ASTOKEN')
this.$lstore.removeData('H5_WECHAT_NICKNAME')
})
})
.catch(
Expand Down

0 comments on commit b62940e

Please sign in to comment.