fix : jwt
Some checks failed
Build Docker / build (push) Has been cancelled

This commit is contained in:
2025-09-13 12:16:13 +08:00
parent a1fdeb9148
commit 48ad2ebd1b
9 changed files with 135 additions and 18 deletions

View File

@@ -18,15 +18,21 @@ use Hyperf\Validation\Annotation\Scene;
#[Middleware(AdminTokenMiddleware::class)]
class AdminUserController
{
/**
* @return array
*/
#[RequestMapping(path: "getInfo", methods: "GET")]
public function getInfo()
public function getInfo(): array
{
return (new UserService)->handle();
}
#[RequestMapping(path: "refresh", methods: "POST")]
public function refresh()
/**
* @return array
*/
#[RequestMapping(path: "logout", methods: "POST")]
public function logout(): array
{
return (new UserService)->refresh();
return (new UserService)->logout();
}
}

View File

@@ -6,10 +6,12 @@ namespace App\Controller\Admin;
use App\Annotation\ResponseFormat;
use App\Controller\AbstractController;
use App\Middleware\Token\RefreshAdminTokenMiddleware;
use App\Request\Admin\LoginRequest;
use App\Service\Admin\Login\LoginService;
use App\Service\Admin\Login\RefreshService;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\Middleware;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Hyperf\Validation\Annotation\Scene;
@@ -25,6 +27,7 @@ final class LoginController extends AbstractController
}
#[RequestMapping(path: "refresh", methods: "POST")]
#[Middleware(RefreshAdminTokenMiddleware::class)]
public function refresh(): array
{
return (new RefreshService)->handle();