| xqd
@@ -113,15 +113,10 @@ class AuthController extends Controller
|
|
|
}else{
|
|
|
$phone_user = UserInfoModel::where('phone',$phone)->first();
|
|
|
if(!empty($phone_user)){
|
|
|
- return $this->error(ErrorCode::USER_DOES_EXIST);
|
|
|
-// if (Auth::attempt(['phone'=>$phone,'password'=>$password])) {
|
|
|
-// $user = Auth::user();
|
|
|
-// \Log::info($user);
|
|
|
-// $token = $user->createToken($user->phone)->accessToken;
|
|
|
-// return $this->api(compact( 'user', 'code','token'));
|
|
|
-// }else{
|
|
|
-// return $this->error(ErrorCode::INCORRECT_USER_OR_PASS);
|
|
|
-// }
|
|
|
+// return $this->error(ErrorCode::USER_DOES_EXIST);
|
|
|
+ $user = $phone_user;
|
|
|
+ $token = $user->createToken($user->phone)->accessToken;
|
|
|
+ return $this->api(compact( 'user', 'code','token'));
|
|
|
}
|
|
|
}
|
|
|
if (empty($user)) {
|