1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-27 21:10:24 +08:00
course-tencent-cloud/app/Services/Frontend/Account/PasswordResetByEmail.php
2020-05-16 19:49:58 +08:00

34 lines
774 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 PasswordResetByEmail extends FrontendService
{
public function handle()
{
$post = $this->request->getPost();
$accountValidator = new AccountValidator();
$account = $accountValidator->checkAccountByEmail($post['email']);
$accountValidator->checkPassword($post['new_password']);
$verifyValidator = new VerifyValidator();
$verifyValidator->checkEmailCode($post['email'], $post['verify_code']);
$account->password = $post['new_password'];
$account->update();
return $account;
}
}