Archived
refactor: 删除旧前端单体,React 产物成为唯一首页来源
为什么:React 迁移已验证完毕(浏览器冒烟全过、golden 刷新), legacy 模板兜底分支指向已删除的文件只会制造幻觉路径。删除 templates/index.html(466KB)与 static/site_auth.js(80KB)及 /static 挂载;jinja2 随兜底分支失去唯一使用者,连同 markupsafe 一并移出依赖(63 包 -2)。_render_index 简化为直接读构建产物—— dist 已入库恒存在,无需分支。
This commit is contained in:
1 parent
17b4a99680
commit
064a89d726
6 files changed
+6
-9236
No files matched your search
@@ -109,11 +109,6 @@ def create_app(api_prefix: str = '', *, start_monitor: bool = True) -> FastAPI:
|
||||
# 响应侧统一处理:安全头 + 音频直链签名保护 + 版本指纹抹除
|
||||
app.add_middleware(ResponseHygieneMiddleware)
|
||||
|
||||
# 静态资源(/static/site_auth.js 等)——与 Flask static_folder 同目录
|
||||
_static_dir = Path(__file__).resolve().parent.parent / 'static'
|
||||
if _static_dir.is_dir():
|
||||
app.mount('/static', StaticFiles(directory=str(_static_dir)), name='static')
|
||||
|
||||
# React 构建产物(vite build → frontend/dist,hash 指纹资源挂 /assets)
|
||||
_dist_dir = Path(__file__).resolve().parent.parent / 'frontend' / 'dist'
|
||||
if (_dist_dir / 'assets').is_dir():
|
||||
|
||||
Reference in new issue
Block a user