Browse Source

修复微信绑定

shenjj 7 years ago
parent
commit
e64a5988d6
1 changed files with 2 additions and 3 deletions
  1. 2 3
      store/index.js

+ 2 - 3
store/index.js

@@ -527,12 +527,10 @@ export const actions = {
     commit('option/REQUEST_WECHATINFO_STATUS')
     return axios.get('/wx/getWxUserInfo', { params: params })
       .then(response => {
-        commit('option/REQUEST_WECHATINFO_STATUS_SUCCESS', response.data)
         let Userinfo = localStorage.getItem('USOFTMALLWECHATINFO')
         Userinfo = Userinfo && JSON.parse(Userinfo) || {}
         localStorage.removeItem('USOFTMALLWECHATINFO')
-        if (response.data.status >= 0) {
-          // 有状态
+        if (response.data.status >= 0) { // 请求到数据
           if (id !== '' && id && id !== undefined) { // 传了openid
             Userinfo.openid = id
           } else { // 没有openid
@@ -543,6 +541,7 @@ export const actions = {
           Userinfo.status = response.data.status
           Userinfo.enterprises = response.data.enterprises
           localStorage.setItem('USOFTMALLWECHATINFO', JSON.stringify(Userinfo))
+          commit('option/REQUEST_WECHATINFO_STATUS_SUCCESS', Userinfo)
         } else {
           // localStorage.removeItem('USOFTMALLWECHATINFO')
         }