This commit is contained in:
Your Name
2026-07-22 10:18:59 +08:00
parent 2530ddada6
commit 0fb03d0bca
618 changed files with 19445 additions and 3 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace app\middleware;
use app\service\AdminScopeService;
use think\exception\HttpResponseException;
class AdminAuth
{
public function handle($request, \Closure $next)
{
$user = $request->authUser ?? null;
if (!$user || !AdminScopeService::canAccessAdmin($user)) {
throw new HttpResponseException(json([
'code' => 1,
'message' => '无管理后台访问权限',
'data' => null,
], 403));
}
return $next($request);
}
}