Browse Source

修复微信 绑定

shenjj 7 years ago
parent
commit
62d18a81f9
1 changed files with 6 additions and 1 deletions
  1. 6 1
      store/index.js

+ 6 - 1
store/index.js

@@ -522,11 +522,16 @@ export const actions = {
   },
   },
   // 保存微信信息
   // 保存微信信息
   GerWechatInfo({ commit }, params = {}) {
   GerWechatInfo({ commit }, params = {}) {
+    let id = params.openId
     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)
         commit('option/REQUEST_WECHATINFO_STATUS_SUCCESS', response.data)
-        if (response.data.openid) {
+        if (response.data.status >= 0) {
+          // 有状态
+          if (id !== '' && !id) {
+            response.data.openid = id
+          }
           localStorage.setItem('USOFTMALLWECHATINFO', JSON.stringify(response.data))
           localStorage.setItem('USOFTMALLWECHATINFO', JSON.stringify(response.data))
         } else {
         } else {
           // localStorage.removeItem('USOFTMALLWECHATINFO')
           // localStorage.removeItem('USOFTMALLWECHATINFO')