This commit is contained in:
qianhao.xu 2025-04-08 18:25:43 +08:00
parent 2e35df01c7
commit 73b3eea1c3
2 changed files with 5 additions and 1 deletions

View File

@ -94,7 +94,6 @@ namespace linesider_screen_bankend.Controller
}
else
{
// 返回成功响应
await this.HttpContext.SendApiFailAsync(500, "工单不在数据库");
}

View File

@ -91,6 +91,11 @@ namespace linesider_screen_bankend.Views
var server = new WebServer(o => o
.WithUrlPrefix(url)
.WithMode(HttpListenerMode.EmbedIO))
.WithCors(
origins: "*", // 允许所有来源,或指定特定来源如 "http://example.com,http://localhost:8080"
headers: "*", // 允许所有头
methods: "*" // 允许所有方法
)
.WithWebApi("/print_api", m => m
.WithController<PrintCommunicationController>(() => new PrintCommunicationController(AddLog))
.WithController<OnlyPrintProductLabelController>(() => new OnlyPrintProductLabelController(AddLog)))