Skip to content

Commit

Permalink
兼容最新的微信小程序获取openid
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyan74 committed Apr 7, 2021
1 parent 7e66296 commit 46f5766
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/modules/v1/controllers/ThirdPartyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function actionWechatMp()

$user = $model->getUser();
$unionid = $user['unionId'] ?? '';
$auth = Yii::$app->services->memberAuth->findOauthClient(Auth::CLIENT_WECHAT_MP, $user['openId']);
$auth = Yii::$app->services->memberAuth->findOauthClient(Auth::CLIENT_WECHAT_MP, $model->getOpenid());
if ($auth && $auth->member) {
$user_info = $this->getData($auth, AccessTokenGroupEnum::WECHAT_MP);
unset($user_info['watermark']);
Expand Down Expand Up @@ -155,7 +155,7 @@ public function actionWechatMp()
'unionid' => $unionid,
'member_id' => $member['id'],
'oauth_client' => Auth::CLIENT_WECHAT_MP,
'oauth_client_user_id' => $user['openId'],
'oauth_client_user_id' => $model->getOpenid(),
'gender' => $user['gender'],
'nickname' => $user['nickName'],
'head_portrait' => $member['head_portrait'],
Expand Down

0 comments on commit 46f5766

Please sign in to comment.