|
|
|
@ -11,7 +11,13 @@ class StoreLoginService implements StoreLoginServiceInterface |
|
|
|
{ |
|
|
|
public function do($account,$password) |
|
|
|
{ |
|
|
|
$storeUsersModel = StoreUsers::query()->where('username',$account)->first(); |
|
|
|
$storeUsersModel = StoreUsers::query()->where([ |
|
|
|
['username','=',$account], |
|
|
|
['status','=',2] |
|
|
|
])->first(); |
|
|
|
if(empty($storeUsersModel)){ |
|
|
|
throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE); |
|
|
|
} |
|
|
|
$password = $this->stringHash($password,$storeUsersModel->salt); |
|
|
|
if($storeUsersModel->password === $password){ |
|
|
|
return $storeUsersModel; |
|
|
|
|