mirror of
https://gitee.com/ctexthuang/hyperf_rbac_framework_server_ctexthuang.git
synced 2025-12-25 23:57:49 +08:00
39 lines
885 B
PHP
39 lines
885 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller\Admin;
|
|
|
|
use App\Annotation\ResponseFormat;
|
|
use App\Middleware\Token\AdminTokenMiddleware;
|
|
use App\Service\Admin\AdminUser\UserService;
|
|
use Hyperf\HttpServer\Annotation\Controller;
|
|
use Hyperf\HttpServer\Annotation\Middleware;
|
|
use Hyperf\HttpServer\Annotation\RequestMapping;
|
|
use Hyperf\Validation\Annotation\Scene;
|
|
|
|
|
|
#[Controller(prefix: "admin/adminUser")]
|
|
#[ResponseFormat('admin')]
|
|
#[Middleware(AdminTokenMiddleware::class)]
|
|
class AdminUserController
|
|
{
|
|
/**
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: "getInfo", methods: "GET")]
|
|
public function getInfo(): array
|
|
{
|
|
return (new UserService)->handle();
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: "logout", methods: "POST")]
|
|
public function logout(): array
|
|
{
|
|
return (new UserService)->logout();
|
|
}
|
|
}
|