update api key manage
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user