update api key manage

This commit is contained in:
2026-04-02 10:40:47 +08:00
parent 9a8431de81
commit 3a2b175028
9 changed files with 1034 additions and 0 deletions
@@ -103,6 +103,13 @@ class AuthMiddleware implements MiddlewareInterface
])->withStatus(403);
}
if (!$user->api_key_enabled) {
return $this->response->json([
'code' => 403,
'message' => 'API Key 功能未启用,请联系管理员开启',
])->withStatus(403);
}
// 更新最后使用时间
$api_key->last_used_at = \Carbon\Carbon::now();
$api_key->save();