From d25fa4bcffcbd50b525b812ceec0f983a83a252f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=82=A5=E7=BE=8A?= <1048382248@qq.com> Date: Thu, 13 Mar 2025 09:48:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=AE=A2=E9=98=85Page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VideoAnalysis/Components/Pages/NodeSubscriptionPage.razor.cs | 3 +-- VideoAnalysis/Expand/CoravelExpand.cs | 2 +- VideoAnalysis/Program.cs | 2 +- VideoAnalysis/appsettings.Production.json | 3 ++- VideoAnalysisCore/Common/Repository.cs | 4 +++- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/VideoAnalysis/Components/Pages/NodeSubscriptionPage.razor.cs b/VideoAnalysis/Components/Pages/NodeSubscriptionPage.razor.cs index d2da975..7bfd977 100644 --- a/VideoAnalysis/Components/Pages/NodeSubscriptionPage.razor.cs +++ b/VideoAnalysis/Components/Pages/NodeSubscriptionPage.razor.cs @@ -75,8 +75,7 @@ namespace Learn.VideoAnalysis.Components.Pages { var data = rowData; modalBtnLoading = true; - await criteria.DeleteAsync(s => s.Subject == editSubject); - await criteria.InsertRangeAsync(_editSource); + await criteria.UpdateAsync(data); _table.ReloadData(); modalShow = false; diff --git a/VideoAnalysis/Expand/CoravelExpand.cs b/VideoAnalysis/Expand/CoravelExpand.cs index 01ab627..df884ec 100644 --- a/VideoAnalysis/Expand/CoravelExpand.cs +++ b/VideoAnalysis/Expand/CoravelExpand.cs @@ -20,7 +20,7 @@ namespace Learn.VideoAnalysis.Expand service.AddScheduler(); service.AddTransient(); } - public static void Run(IServiceProvider provider) + public static void UseCoravelExpand(this IServiceProvider provider) { provider.UseScheduler(scheduler => { diff --git a/VideoAnalysis/Program.cs b/VideoAnalysis/Program.cs index a4e7bbf..27bdfd7 100644 --- a/VideoAnalysis/Program.cs +++ b/VideoAnalysis/Program.cs @@ -134,7 +134,7 @@ namespace Learn.VideoAnalysis //自定义 应用 SqlSugarExpand.InitDB(); - CoravelExpand.Run(app.Services); + app.Services.UseCoravelExpand(); app.Run(); diff --git a/VideoAnalysis/appsettings.Production.json b/VideoAnalysis/appsettings.Production.json index afd83dc..0c43baa 100644 --- a/VideoAnalysis/appsettings.Production.json +++ b/VideoAnalysis/appsettings.Production.json @@ -13,7 +13,8 @@ " TimeSlice": 600 }, "DB": { - "ConnectionString": "AllowLoadLocalInfile=true;Server=10.255.255.3;Port=3306;Database=learn.videoanalysis;User ID=marking;Password=qwe123!@#;CharSet=utf8mb4;pooling=true;SslMode=None", + //"ConnectionString": "AllowLoadLocalInfile=true;Server=10.255.255.3;Port=3306;Database=learn.videoanalysis;User ID=marking;Password=qwe123!@#;CharSet=utf8mb4;pooling=true;SslMode=None", + "ConnectionString": "AllowLoadLocalInfile=true;Server=rm-2vc20nd3d11g0oh6g.rwlb.cn-chengdu.rds.aliyuncs.com;User ID=marking;Password=poiuytPOIUYT098765)(*&^%;Port=3306;Database=learn.videoanalysis;CharSet=utf8mb4;pooling=true;SslMode=None", "SqlType": "MySql", "UpdateTable": false } diff --git a/VideoAnalysisCore/Common/Repository.cs b/VideoAnalysisCore/Common/Repository.cs index d990a64..332ea87 100644 --- a/VideoAnalysisCore/Common/Repository.cs +++ b/VideoAnalysisCore/Common/Repository.cs @@ -23,7 +23,9 @@ namespace VideoAnalysisCore.Common var t = typeof(T); if (CID.ContainsKey(t)) { - base.Context = DbScoped.Sugar.GetConnectionScope(CID[t]); + base.Context = CID[t]!=null + ? DbScoped.Sugar.GetConnectionScope(CID[t]) + : DbScoped.Sugar; return; } var c = t.GetCustomAttribute();