1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-25 04:07:17 +08:00
2020-05-16 19:49:58 +08:00

34 lines
761 B
PHP

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