fix(api): fix API Key rate limiting and terminal user quota checks

- Revert API Key rate limit handling to throw an error instead of auto-capping when exceeding the plan limit.
- Optimize terminal user quota check logic to validate only during new user creation, avoiding redundant checks.
- Add method to query terminal users by `workspace_id` and `other_id`.
This commit is contained in:
wwq
2026-04-21 20:48:06 +08:00
parent 8bb5a66401
commit ad4121b0d8
4 changed files with 47 additions and 6 deletions

View File

@@ -167,6 +167,8 @@ def update_api_key(
return success(data=api_key_schema.ApiKey.model_validate(api_key), msg="API Key 更新成功")
except BusinessException:
raise
except Exception as e:
logger.error(f"未知错误: {str(e)}", extra={
"api_key_id": str(api_key_id),