小程序登录

This commit is contained in:
2025-11-25 09:19:25 +08:00
parent d5491511f7
commit 48a77a09b0
7 changed files with 11 additions and 8 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ class BasicDataService
*/
private function getAllLoginTypes()
{
return ['upwd', 'feishu', 'qrcode']; // 示例数据
return ['upwd', 'feishu', 'wechat', 'qrcode']; // 示例数据
}
/**
+4 -2
View File
@@ -187,7 +187,8 @@ class UserService
$session = $logic->miniCode2Session($loginCode);
if (!isset($session['openid'])) {
return json(['code'=>0, 'msg'=>'登录失败', 'data'=>$session]);
throw new BusinessException('登录失败');
// return json(['code'=>0, 'msg'=>'登录失败', 'data'=>$session]);
}
$openid = $session['openid'];
@@ -199,7 +200,8 @@ class UserService
$phoneData = $logic->getMiniPhoneNumber($access_token, $phoneCode);
if (!isset($phoneData['phone_info']['phoneNumber'])) {
return json(['code'=>0, 'msg'=>'获取手机号失败', 'data'=>$phoneData]);
throw new BusinessException('获取手机号失败');
// return json(['code'=>0, 'msg'=>'获取手机号失败', 'data'=>$phoneData]);
}
$phone = $phoneData['phone_info']['phoneNumber'];
+1
View File
@@ -13,6 +13,7 @@ class WechatService
{
protected array $web;
protected array $mini;
protected array $login;
protected $app;