bug fixed

This commit is contained in:
lik
2026-10-07 15:51:23 +08:00
parent 1974975882
commit f0edd6d548
3 changed files with 10 additions and 11 deletions
+5
View File
@@ -20,6 +20,11 @@ class APP {
}
setupMiddleware() {
// 服务在 nginx 之后,需信任代理头才能拿到真实客户端 IP
// (否则 ctx.ip 恒为 127.0.0.1,限流会变成全站共享一个桶)
this.app.proxy = true;
this.app.proxyIpHeader = "X-Real-IP";
this.app.use(cors());
this.app.use(bodyParser());