From 1c5b9ed3c895507d0af0b4f28cd9c7738e0b9c0f Mon Sep 17 00:00:00 2001 From: lq1405 <2769838458@qq.com> Date: Sun, 23 Feb 2025 21:06:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=9A=E7=94=A8=E7=9A=84op?= =?UTF-8?q?tion=E5=92=8C=E6=B7=BB=E5=8A=A0201=E7=8A=B6=E6=80=81=E7=A0=81?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LMS.Common/Dictionary/SimpleOptions.cs | 5 ++++- LMS.service/Service/ForwardWordService.cs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/LMS.Common/Dictionary/SimpleOptions.cs b/LMS.Common/Dictionary/SimpleOptions.cs index af94ff7..3834b93 100644 --- a/LMS.Common/Dictionary/SimpleOptions.cs +++ b/LMS.Common/Dictionary/SimpleOptions.cs @@ -1,4 +1,6 @@ -namespace LMS.Common.Dictionary; +using LMS.Common.Enum; + +namespace LMS.Common.Dictionary; public class SimpleOptions { @@ -6,5 +8,6 @@ public class SimpleOptions { { "ttsrole", ["EdgeTTsRoles"] }, { "laitoolinfo", ["LaitoolHomePage", "LaitoolNotice", "LaitoolUpdateContent", "LaitoolVersion"] }, + { OptionKeyName.LaitoolFluxApiModelList, [OptionKeyName.LaitoolFluxApiModelList] } }; } \ No newline at end of file diff --git a/LMS.service/Service/ForwardWordService.cs b/LMS.service/Service/ForwardWordService.cs index 219c22b..4c0183a 100644 --- a/LMS.service/Service/ForwardWordService.cs +++ b/LMS.service/Service/ForwardWordService.cs @@ -199,7 +199,7 @@ public class ForwardWordService(ApplicationDbContext context) var response = await client.PostAsync(request.url, new StringContent(request.dataString, Encoding.UTF8, "application/json")); // 判断返回的状态码 - if (response.StatusCode != HttpStatusCode.OK) + if (response.StatusCode != HttpStatusCode.OK && response.StatusCode != HttpStatusCode.Created) { if (response.StatusCode == HttpStatusCode.Unauthorized) { @@ -254,7 +254,7 @@ public class ForwardWordService(ApplicationDbContext context) client.Timeout = Timeout.InfiniteTimeSpan; var response = await client.GetAsync(getTransferModel.url); // 判断返回的状态码 - if (response.StatusCode != HttpStatusCode.OK) + if (response.StatusCode != HttpStatusCode.OK && response.StatusCode != HttpStatusCode.Created) { // 读取响应体 string responseContent = await response.Content.ReadAsStringAsync();