add a js version controling
This commit is contained in:
@@ -245,7 +245,8 @@ def create_app(
|
|||||||
page = static_dir / "admin.html"
|
page = static_dir / "admin.html"
|
||||||
if not page.is_file():
|
if not page.is_file():
|
||||||
raise HTTPException(status_code=404, detail="Admin UI is not installed.")
|
raise HTTPException(status_code=404, detail="Admin UI is not installed.")
|
||||||
return FileResponse(page)
|
# 后台页面本身不缓存,静态 JS 通过版本号刷新,避免发布后浏览器继续跑旧逻辑。
|
||||||
|
return FileResponse(page, headers={"Cache-Control": "no-cache"})
|
||||||
|
|
||||||
@application.get("/api/v1/videos", response_model=VideoListResponse)
|
@application.get("/api/v1/videos", response_model=VideoListResponse)
|
||||||
def list_videos() -> VideoListResponse:
|
def list_videos() -> VideoListResponse:
|
||||||
|
|||||||
@@ -91,6 +91,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|
||||||
<script src="/static/admin.js?v=boundary-adjust-v1" defer></script>
|
<script src="/static/admin.js?v=admin-title-autofill-v2" defer></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user