Refactor auth and unify error handling in routers

Renamed AuthRequired/AdminRequired to auth_required/admin_required and updated all references. Replaced direct HTTPException usage with utils.http_exceptions for consistent error handling. Updated router endpoints to use new auth dependency and standardized not implemented responses. Cleaned up unused theme fields in SiteConfigResponse and improved site config endpoint. Minor type and import cleanups across routers and middleware.
This commit is contained in:
2025-12-25 19:08:46 +08:00
parent 5835b4c626
commit abd85e2290
24 changed files with 347 additions and 391 deletions

View File

@@ -20,11 +20,11 @@ class SiteConfigResponse(SQLModelBase):
title: str = "DiskNext"
"""网站标题"""
themes: dict[str, str] = {}
"""网站主题配置"""
# themes: dict[str, str] = {}
# """网站主题配置"""
default_theme: dict[str, str] = {}
"""默认主题RGB色号"""
# default_theme: dict[str, str] = {}
# """默认主题RGB色号"""
site_notice: str | None = None
"""网站公告"""