1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-28 05:11:39 +08:00
xiaochong0302 c0e38d68fd 精简auth
2020-04-07 19:32:00 +08:00

34 lines
757 B
PHP

<?php
namespace App\Services\Frontend\Account;
use App\Services\Frontend\Service;
use App\Validators\Account as AccountValidator;
use App\Validators\Security as SecurityValidator;
class PasswordReset extends Service
{
public function resetPassword()
{
$post = $this->request->getPost();
$accountValidator = new AccountValidator();
$account = $accountValidator->checkLoginName($post['account']);
$accountValidator->checkPassword($post['new_password']);
$securityValidator = new SecurityValidator();
$securityValidator->checkVerifyCode($post['account'], $post['verify_code']);
$account->password = $post['new_password'];
$account->update();
return $account;
}
}