1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-26 12:23:06 +08:00
xiaochong0302 c0e38d68fd 精简auth
2020-04-07 19:32:00 +08:00

34 lines
655 B
PHP

<?php
namespace App\Http\Api\Services;
use App\Services\Auth\Api as ApiAuth;
use App\Validators\Account as AccountValidator;
class Login extends Service
{
public function loginByPassword($name, $password)
{
$validator = new AccountValidator();
$user = $validator->checkUserLogin($name, $password);
$auth = new ApiAuth();
return $auth->saveAuthInfo($user);
}
public function loginByVerify($name, $code)
{
$validator = new AccountValidator();
$user = $validator->checkVerifyLogin($name, $code);
$auth = new ApiAuth();
return $auth->saveAuthInfo($user);
}
}