W0: 网关API封装+数据模型+CORS启用

This commit is contained in:
2026-05-17 15:36:44 +08:00
parent bec241be15
commit 21f1df4dac
2 changed files with 129 additions and 0 deletions

View File

@@ -27,7 +27,10 @@ builder.Services.AddHttpClient("VolPro", c =>
MaxConnectionsPerServer = 10
});
builder.Services.AddCors(o => o.AddDefaultPolicy(p => p.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()));
var app = builder.Build();
app.UseCors();
// ── 读取配置 ──
var gwCfg = app.Configuration.GetSection("Gateway");