Skip to content

Commit b62940e

Browse files
committed
fix(SPA): 微信登录时获取不到access_token的问题
1 parent 72f3a6e commit b62940e

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

resources/spa/src/page/wechat/WechatBindUser.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ export default {
156156
this.$store.dispatch('GET_UNREAD_COUNT')
157157
this.$store.dispatch('GET_NEW_UNREAD_COUNT')
158158
this.$store.commit('SAVE_USER', user)
159-
this.$lstore.removeData('H5_WECHAT_MP_OPENID')
160-
this.$lstore.removeData('H5_WECHAT_MP_ASTOKEN')
161159
})
162160
})
163161
.finally(() => {

resources/spa/src/page/wechat/WechatSignin.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export default {
9494
this.$http
9595
.post(
9696
'socialite/wechat',
97-
{ access_token: accessToken },
97+
{ access_token: this.accessToken },
9898
{ validateStatus: s => s === 201 || s === 404 }
9999
)
100100
.then(({ status, data: { token = '', user = {} } = {} }) => {
@@ -106,8 +106,6 @@ export default {
106106
// 保存用户信息 并跳转
107107
this.$router.push(this.$route.query.redirect || '/feeds?type=hot')
108108
this.$nextTick(() => {
109-
this.$lstore.removeData('H5_WECHAT_MP_OPENID')
110-
this.$lstore.removeData('H5_WECHAT_MP_ASTOKEN')
111109
this.$store.commit('SAVE_USER', user)
112110
this.$store.dispatch('GET_UNREAD_COUNT')
113111
this.$store.dispatch('GET_NEW_UNREAD_COUNT')

resources/spa/src/page/wechat/WechatSignup.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,6 @@ export default {
147147
this.$store.dispatch('GET_UNREAD_COUNT')
148148
this.$store.dispatch('GET_NEW_UNREAD_COUNT')
149149
this.$store.commit('SAVE_USER', user)
150-
this.$lstore.removeData('H5_WECHAT_MP_OPENID')
151-
this.$lstore.removeData('H5_WECHAT_MP_ASTOKEN')
152-
this.$lstore.removeData('H5_WECHAT_NICKNAME')
153150
})
154151
})
155152
.catch(

0 commit comments

Comments
 (0)