1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-07-06 17:01:11 +08:00
2020-05-04 19:13:33 +08:00

34 lines
744 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 handle()
{
$post = $this->request->getPost();
$accountValidator = new AccountValidator();
$account = $accountValidator->checkLoginName($post['name']);
$accountValidator->checkPassword($post['new_password']);
$securityValidator = new SecurityValidator();
$securityValidator->checkVerifyCode($post['name'], $post['verify_code']);
$account->password = $post['new_password'];
$account->update();
return $account;
}
}