36 lines
947 B
PHP
36 lines
947 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller\Admin;
|
|
|
|
use App\Controller\AbstractController;
|
|
use App\Request\Admin\LoginRequest;
|
|
use App\Service\Admin\Login\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): array
|
|
{
|
|
$service = new LoginService();
|
|
return $service->handle();
|
|
}
|
|
}
|