This commit is contained in:
qianhao.xu 2025-04-08 18:49:48 +08:00
parent 73b3eea1c3
commit f8055b8e6a

View File

@ -91,10 +91,10 @@ 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: "*" // 允许所有方法
.WithCors(
origins: "http://localhost:7005",
headers: "content-type,authorization",
methods: "GET,POST,PUT,DELETE"
)
.WithWebApi("/print_api", m => m
.WithController<PrintCommunicationController>(() => new PrintCommunicationController(AddLog))
@ -140,5 +140,5 @@ namespace linesider_screen_bankend.Views
}
}
}