Browse Source

修复微信 绑定

shenjj 7 years ago
parent
commit
21069a9efa
1 changed files with 5 additions and 1 deletions
  1. 5 1
      store/index.js

+ 5 - 1
store/index.js

@@ -533,8 +533,12 @@ export const actions = {
         localStorage.removeItem('USOFTMALLWECHATINFO')
         localStorage.removeItem('USOFTMALLWECHATINFO')
         if (response.data.status >= 0) {
         if (response.data.status >= 0) {
           // 有状态
           // 有状态
-          if (id !== '' && id && id !== undefined) {
+          if (id !== '' && id && id !== undefined) { // 传了openid
             Userinfo.openid = id
             Userinfo.openid = id
+          } else { // 没有openid
+            Userinfo.headimgurl = response.data.headimgurl
+            Userinfo.nickname = response.data.nickname
+            Userinfo.openid = response.data.openid
           }
           }
           Userinfo.status = response.data.status
           Userinfo.status = response.data.status
           Userinfo.enterprises = response.data.enterprises
           Userinfo.enterprises = response.data.enterprises