提交代码
This commit is contained in:
+14
-2
@@ -56,8 +56,8 @@ builder.Services.AddSingleton<AdminAccessService>();
|
||||
// 8. 靶样轮廓识别与采样点规划(ONNX 模型分割)
|
||||
builder.Services.Configure<OnnxSegmentationOptions>(
|
||||
builder.Configuration.GetSection(OnnxSegmentationOptions.SectionName));
|
||||
builder.Services.AddSingleton<BackgroundDiffSegmenter>();
|
||||
builder.Services.AddSingleton<TargetOutlineAnalyzer>();
|
||||
builder.Services.AddHostedService<SampleAnalysisWarmupService>();
|
||||
builder.Services.AddSingleton<ISampleAnalysisService, SampleAnalysisService>();
|
||||
|
||||
// 9. 位移台:串口优先取系统参数 translation_com,未配置时回退到 appsettings 的 AxisStage:ComPort
|
||||
@@ -105,7 +105,19 @@ app.UseAuthorization();
|
||||
|
||||
//这两行是用来托管前端的
|
||||
app.UseDefaultFiles();
|
||||
app.UseStaticFiles();
|
||||
app.UseStaticFiles(new StaticFileOptions
|
||||
{
|
||||
OnPrepareResponse = context =>
|
||||
{
|
||||
// 入口页禁止缓存,避免前端重新构建后浏览器仍加载旧的 JS 资源。
|
||||
if (string.Equals(
|
||||
context.File.Name, "index.html", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
context.Context.Response.Headers.CacheControl =
|
||||
"no-cache, no-store, must-revalidate";
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user