Explorar o código

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

evoxwht %!s(int64=4) %!d(string=hai) anos
pai
achega
574b1fc469
Modificáronse 1 ficheiros con 1 adicións e 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'];