update api key

This commit is contained in:
2026-04-02 14:41:31 +08:00
parent 3a2b175028
commit d28a014209
4 changed files with 14 additions and 5 deletions
@@ -94,6 +94,13 @@ class AuthMiddleware implements MiddlewareInterface
])->withStatus(401);
}
if (!$api_key->enabled) {
return $this->response->json([
'code' => 403,
'message' => '该 API Key 已被禁用',
])->withStatus(403);
}
$user = $api_key->user;
if (!$user || $user->status !== 1) {