|
|
@@ -72,7 +72,11 @@ class Login extends BaseService
|
|
|
public function loginMpWx(array $form): bool
|
|
|
{
|
|
|
// 获取微信小程序登录态(session)
|
|
|
- $wxSession = PartyService::getMpWxSession($form['code']);
|
|
|
+ if(!isset($form['partyData'])){
|
|
|
+ $form['partyData'] = $form;
|
|
|
+ }
|
|
|
+
|
|
|
+ $wxSession = PartyService::getMpWxSession($form['partyData']['code']);
|
|
|
|
|
|
// 判断openid是否存在
|
|
|
$userId = OauthService::getUserIdByOauthId($wxSession['openid'], 'MP-WEIXIN');
|
|
|
@@ -83,7 +87,7 @@ class Login extends BaseService
|
|
|
// 用户信息存在, 更新登录信息
|
|
|
if (!empty($userInfo)) {
|
|
|
// 更新用户登录信息
|
|
|
- $this->updateUser($userInfo, true, $form);
|
|
|
+ $this->updateUser($userInfo, true, $form['partyData']);
|
|
|
// 记录登录态
|
|
|
return $this->setSession();
|
|
|
}
|
|
|
@@ -97,9 +101,9 @@ class Login extends BaseService
|
|
|
// 后台未开启强制绑定手机号, 直接保存新用户
|
|
|
if (!$setting['isForceBindMpweixin']) {
|
|
|
// 用户不存在: 创建一个新用户
|
|
|
- $this->createUser('', true, $form);
|
|
|
+ $this->createUser('', true, $form['partyData']);
|
|
|
// 保存第三方用户信息
|
|
|
- $this->createUserOauth($this->getUserId(), true, $form);
|
|
|
+ $this->createUserOauth($this->getUserId(), true, $form['partyData']);
|
|
|
}
|
|
|
// 记录登录态
|
|
|
return $this->setSession();
|