Преглед изворни кода

fix: 系统配置应修改应用模块中的数据

喵你个旺呀 пре 1 година
родитељ
комит
6617b8ce89
1 измењених фајлова са 11 додато и 8 уклоњено
  1. 11 8
      Admin.NET/Admin.NET.Core/Service/Config/SysConfigService.cs

+ 11 - 8
Admin.NET/Admin.NET.Core/Service/Config/SysConfigService.cs

@@ -277,6 +277,7 @@ public class SysConfigService : IDynamicApiController, ITransient
     public async Task SaveSysInfo(InfoSaveInput input)
     {
         // logo 不为空才保存
+        var app = await App.GetRequiredService<SysAppService>().GetCurrentAppInfo();
         if (!string.IsNullOrEmpty(input.SysLogoBase64))
         {
             // 旧图标文件相对路径
@@ -305,16 +306,18 @@ public class SysConfigService : IDynamicApiController, ITransient
             await File.WriteAllBytesAsync(absoluteFilePath, binData);
 
             // 保存图标配置
-            var relativeUrl = $"/{path}/logo{ext}";
-            await UpdateConfigValue(ConfigConst.SysWebLogo, relativeUrl);
+            app.Logo = $"/{path}/logo{ext}";
         }
 
-        await UpdateConfigValue(ConfigConst.SysWebTitle, input.SysTitle);
-        await UpdateConfigValue(ConfigConst.SysWebViceTitle, input.SysViceTitle);
-        await UpdateConfigValue(ConfigConst.SysWebViceDesc, input.SysViceDesc);
-        await UpdateConfigValue(ConfigConst.SysWebWatermark, input.SysWatermark);
-        await UpdateConfigValue(ConfigConst.SysWebCopyright, input.SysCopyright);
-        await UpdateConfigValue(ConfigConst.SysWebIcp, input.SysIcp);
+        app.Logo = input.SysTitle;
+        app.ViceTitle = input.SysViceTitle;
+        app.ViceDesc = input.SysViceDesc;
+        app.Watermark = input.SysWatermark;
+        app.Copyright = input.SysCopyright;
+        app.Icp = input.SysIcp;
+
+        await _sysConfigRep.Context.Updateable(app).ExecuteCommandAsync();
+        
         await UpdateConfigValue(ConfigConst.SysWebIcpUrl, input.SysIcpUrl);
         await UpdateConfigValue(ConfigConst.SysSecondVer, (input.SysSecondVer ?? false).ToString());
         await UpdateConfigValue(ConfigConst.SysCaptcha, (input.SysCaptcha ?? true).ToString());