This commit is contained in:
Logan committed 2026-07-09 14:16:56 +08:00
1 parent 0690285147
commit 5618cd2738
154 files changed
+5021 -3161

No files matched your search

+7
View File
@@ -68,6 +68,13 @@ func setupFrontend(r *gin.Engine) {
return
}
if strings.HasPrefix(cleanPath, "assets/") {
// 构建哈希资源缺失时返回真实 404,避免 SPA fallback 把 index.html 当 JS 模块返回。 // Logan.Li
c.Header("Cache-Control", "no-store, no-cache, must-revalidate")
c.String(http.StatusNotFound, "static asset not found")
return
}
// SPA fallback → 直接返回 index.html 字节(避免 http.FileServer 的 301 redirect)
indexBytes, err := fs.ReadFile(staticFS, "index.html")
if err != nil {