feat: jwt
This commit is contained in:
@@ -10,13 +10,24 @@ use App\Service\Admin\User\LoginService;
|
||||
use Hyperf\HttpServer\Annotation\Controller;
|
||||
use Hyperf\HttpServer\Annotation\RequestMapping;
|
||||
use Hyperf\Validation\Annotation\Scene;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use RedisException;
|
||||
|
||||
#[Controller(prefix: "admin/login")]
|
||||
class LoginController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* 登录
|
||||
* @param LoginRequest $request
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @throws RedisException
|
||||
*/
|
||||
#[RequestMapping(path: "user", methods: "POST")]
|
||||
#[Scene(scene: "login")]
|
||||
public function login(LoginRequest $request)
|
||||
public function login(LoginRequest $request): array
|
||||
{
|
||||
$service = new LoginService();
|
||||
return $service->handle();
|
||||
|
||||
Reference in New Issue
Block a user