1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-07-23 08:26:40 +08:00
xiaochong0302 5384cb8c87 优化
2020-05-06 20:14:50 +08:00

34 lines
740 B
PHP

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