diff --git a/app/controller/admin/auth/AuthController.php b/app/controller/admin/auth/AuthController.php index f34def9..ce79096 100644 --- a/app/controller/admin/auth/AuthController.php +++ b/app/controller/admin/auth/AuthController.php @@ -52,9 +52,15 @@ class AuthController extends BaseController 'client_name'=> $client->name, 'user_id' => $this->auth->userId, ])->find(); - if($clientModel) { - if($clientModel['lock_password'] !== $password) { - return $this->writeError('密码错误'); + if($clientModel && $clientModel['is_lock']) { + if (empty($clientModel['lock_password'])) { + if(!password_verify($password, $this->auth->getUser()->password)) { + return $this->writeError('密码错误'); + } + }else{ + if($clientModel['lock_password'] !== $password) { + return $this->writeError('密码错误'); + } } $clientModel->save(['is_lock'=>0,'lock_password'=>'','lock_time'=>null]); }