Sfoglia il codice sorgente

修复微信绑定

shenjj 7 anni fa
parent
commit
e64a5988d6
1 ha cambiato i file con 2 aggiunte e 3 eliminazioni
  1. 2 3
      store/index.js

+ 2 - 3
store/index.js

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