diff --git a/app/Service/v3/Implementations/WxLoginService.php b/app/Service/v3/Implementations/WxLoginService.php index 032e788..4b9828d 100644 --- a/app/Service/v3/Implementations/WxLoginService.php +++ b/app/Service/v3/Implementations/WxLoginService.php @@ -31,7 +31,7 @@ class WxLoginService implements \App\Service\v3\Interfaces\WxLoginServiceInterfa // 更新或者插入用户数据 $user = User::query()->firstOrCreate( ['openid' => $result['openid']], - ['unionid' => $result['unionid']] + ['unionid' => ($result['unionid'] ?? '')] )->toArray(); // 登录成功