diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index f33ab5e5..a5831380 100755 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -753,11 +753,12 @@ class Auth extends BaseController $isNewUser = true; $user = $repository->registr($data['phone'], null, $data['user_type']); } + $spreadId = empty($data['spread']) ? $user['spread_uid'] : $data['spread']; if ($auth && !$user['wechat_user_id']) { $repository->syncBaseAuth($auth, $user); } $user = $repository->mainUser($user); - $repository->bindSpread($user, intval($data['spread'])); + $repository->bindSpread($user, intval($spreadId)); $tokenInfo = $repository->createToken($user); $repository->loginAfter($user);