Explorar el Código

修复小程序授权绑定开放平台问题

evoxwht hace 4 años
padre
commit
574b1fc469
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      crmeb/app/api/controller/wechat/AuthController.php

+ 1 - 1
crmeb/app/api/controller/wechat/AuthController.php

@@ -68,7 +68,7 @@ class AuthController
             if ($e->getCode() == '-41003') return app('json')->fail('获取会话密匙失败');
         }
         if (!isset($userInfoCong['openid'])) return app('json')->fail('openid获取失败');
-        if (!isset($userInfo['unionId'])) $userInfo['unionId'] = '';
+        $userInfo['unionId'] = isset($userInfoCong['unionid']) ? $userInfoCong['unionid'] : '';
         $userInfo['openId'] = $userInfoCong['openid'];
         $userInfo['spid'] = $data['spread_spid'];
         $userInfo['code'] = $data['spread_code'];