This commit is contained in:
2026-08-26 17:50:41 +08:00
parent d3866efcd8
commit f9adabf5d8
13 changed files with 10 additions and 29 deletions

View File

@@ -0,0 +1,24 @@
<?php
declare (strict_types = 1);
namespace app\middleware;
use app\common\Trait\ApiResponse;
use think\facade\Session;
class CheckLogin
{
use ApiResponse;
/**
* 处理请求
* @param \think\Request $request
* @param \Closure $next
* @return Response
*/
public function handle($request, \Closure $next)
{
if (!Session::has('user_info')) {
return $this->error('未登录', [], 401);
}
return $next($request);
}
}