Browse Source

fix:测试

super-yimizi 1 month ago
parent
commit
3dcc247172
1 changed files with 3 additions and 1 deletions
  1. 3 1
      application/api/controller/Login.php

+ 3 - 1
application/api/controller/Login.php

@@ -275,7 +275,9 @@ class Login extends Base
         if ($data) {
             $mobile = $data['phoneNumber'];
             //获取openid和unionid
-            $json = (new WechatService(Wechat::miniProgram()))->getWechatSession($logincode);
+            if (!empty($logincode)) {
+                $json = (new WechatService(Wechat::miniProgram()))->getWechatSession($logincode);
+            }
             $openid = $json['openid'] ?? '';
             $unionid = $json['unionid'] ?? '';