修复bug

This commit is contained in:
hero920103 committed 2026-10-19 17:34:11 +08:00
1 parent 1850ac640e
commit 892ba5886d
20 files changed
+1078 -178

No files matched your search

+1
View File
@@ -310,6 +310,7 @@ func RegisterAuthRoutes() {
beego.Router("/backend/reimbursements/:id/items/:item_id", &controllers.BackendReimburseController{}, "post:UpdateItem;delete:DeleteItem")
beego.Router("/backend/reimbursements/:id", &controllers.BackendReimburseController{}, "get:Detail;post:Update;delete:Delete")
beego.Router("/backend/reimbursements/:id/submit", &controllers.BackendReimburseController{}, "post:Submit")
beego.Router("/backend/reimbursements/:id/withdraw", &controllers.BackendReimburseController{}, "post:Withdraw")
beego.Router("/backend/reimbursements/:id/status", &controllers.BackendReimburseController{}, "post:UpdateStatus")
beego.Router("/backend/reimbursements/:id/records", &controllers.BackendReimburseController{}, "get:Records")
+6
View File
@@ -18,6 +18,12 @@ import (
// 初始化路由(精简版)
func init() {
// 扫描器探针降噪:.env / config.js / credentials.json / Go 源码路径等探测请求不再逐条打印,
// 全部 404 时只定期汇总「未发现泄露」,一旦返回 2xx 立即告警具体路径。
// dev 模式的 `[D] router.go` 访问日志由 middleware 的 filterconsole 适配器过滤,
// 这里保留 DefaultAccessLogFilter 仅用于 AccessLogs 开启的场景。
beego.DefaultAccessLogFilter = middleware.NewSecurityProbeLogFilter(beego.DefaultAccessLogFilter)
// 全局 CORS 处理 + 预检请求
// 注意:Allow-Origin 为 * 时不能同时设置 Allow-Credentials: true,否则浏览器会拒绝带 Authorization 的预检(上传/接口跨域常见现象)。
// 当前 JWT 走 Header、前端 axios withCredentials=false,无需携带 Cookie,故不返回 Allow-Credentials。
+3 -1
View File
@@ -75,7 +75,9 @@ func RegisterPlatformSPA(spaDir string, hosts ...string) {
return
}
// SPA fallback:未知路径(hash 路由直接访问 /xxx/yyy)回 index.html
// SPA fallback:未知路径(hash 路由直接访问 /xxx/yyy)回 index.html。
// 标记一下,避免安全探针过滤器把「兜底返回首页」误判成敏感文件泄露。
ctx.Input.SetData("spa_fallback", true)
http.ServeFile(ctx.ResponseWriter, ctx.Request, spaDir+"/index.html")
})
}