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

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