feat: Enhance file management and user features

- Add file deduplication mechanism based on PhysicalFile reference counting.
- Implement chunked upload support for large files with resumable uploads.
- Update sharing page to automatically render README and preview content.
- Integrate Redis for caching and token storage (optional).
- Refactor project structure to include new models for download tasks, nodes, and tasks.
- Introduce user filtering parameters for admin user management.
- Add CORS middleware for handling cross-origin requests.
- Improve error messages for authentication failures.
- Update user model to include two-factor authentication key management.
- Enhance API documentation and response models for clarity.
- Implement admin checks for user management and permissions.
This commit is contained in:
2026-01-13 15:29:52 +08:00
parent 61ddc96f17
commit b12aad4e73
13 changed files with 467 additions and 4512 deletions

View File

@@ -33,7 +33,7 @@ async def auth_required(
return user
except jwt.InvalidTokenError:
http_exceptions.raise_unauthorized("账号或密码错误")
http_exceptions.raise_unauthorized("凭据过期或无效")
async def admin_required(
user: Annotated[User, Depends(auth_required)],