zxhxx 3 лет назад
Родитель
Сommit
f377161ed8
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      application/api/controller/MiniProgram.php

+ 1 - 1
application/api/controller/MiniProgram.php

@@ -58,7 +58,7 @@ class MiniProgram extends  Api
             $this->error('签名无效,重新刷新'.$e->getMessage());
         }
         if (!isset($userInfo['unionId'])) $userInfo['unionId'] = '';
-        if(!$userInfo['openId'])  $userInfo['openId'] = $userInfoCong['openid'];
+        if(!$userInfo['openId'] && isset($userInfoCong['openid']))  $userInfo['openId'] = $userInfoCong['openid'];
         if(!$userInfo['openId']) $this->error('获取openId失败!');
         User::routineOauth($userInfo);
         $user = User::where('id', UserRelation::openidToUid($userInfo['openId'], 'routine_openid'))->find();