Ver Fonte

🤓1、升级NuGet包 2、其他细节优化

zuohuaijun há 3 anos atrás
pai
commit
72942ee1b3

+ 5 - 5
Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj

@@ -21,9 +21,9 @@
     <PackageReference Include="DotNetCore.Compile.Environment" Version="3.2.0" />
     <PackageReference Include="DotNetCore.Natasha.CSharp" Version="5.1.0" />
     <PackageReference Include="FluentEmail.Smtp" Version="3.0.2" />
-    <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.7.19" />
-    <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.7.19" />
-    <PackageReference Include="Furion.Pure" Version="4.8.7.19" />
+    <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.7.29" />
+    <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.7.29" />
+    <PackageReference Include="Furion.Pure" Version="4.8.7.29" />
     <PackageReference Include="IPTools.China" Version="1.6.0" />
     <PackageReference Include="Lazy.Captcha.Core" Version="2.0.3" />
     <PackageReference Include="Magicodes.IE.Excel" Version="2.7.4.3" />
@@ -32,9 +32,9 @@
     <PackageReference Include="NEST" Version="7.17.5" />
     <PackageReference Include="NewLife.Redis" Version="5.2.2023.301" />
     <PackageReference Include="OnceMi.AspNetCore.OSS" Version="1.1.9" />
-    <PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="2.25.0" />
+    <PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="2.26.0" />
     <PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="2.16.0" />
-    <PackageReference Include="SqlSugarCore" Version="5.1.4.60" />
+    <PackageReference Include="SqlSugarCore" Version="5.1.4.63" />
     <PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.1" />
     <PackageReference Include="UAParser" Version="3.1.47" />
     <PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />

+ 1 - 1
Admin.NET/Admin.NET.Core/Service/Auth/Dto/LoginInput.cs

@@ -9,7 +9,7 @@ public class LoginInput
     /// 账号
     /// </summary>
     /// <example>admin</example>
-    [Required(ErrorMessage = "账号不能为空"), MinLength(3, ErrorMessage = "账号不能少于3个字符")]
+    [Required(ErrorMessage = "账号不能为空"), MinLength(2, ErrorMessage = "账号不能少于2个字符")]
     public string Account { get; set; }
 
     /// <summary>

+ 2 - 2
Admin.NET/Admin.NET.Core/Service/Dict/SysDictDataService.cs

@@ -51,7 +51,7 @@ public class SysDictDataService : IDynamicApiController, ITransient
     [DisplayName("增加字典值")]
     public async Task AddDictData(AddDictDataInput input)
     {
-        var isExist = await _sysDictDataRep.IsAnyAsync(u => (u.Code == input.Code || u.Value == input.Value) && u.DictTypeId == input.DictTypeId);
+        var isExist = await _sysDictDataRep.IsAnyAsync(u => u.Code == input.Code && u.DictTypeId == input.DictTypeId);
         if (isExist)
             throw Oops.Oh(ErrorCodeEnum.D3003);
 
@@ -70,7 +70,7 @@ public class SysDictDataService : IDynamicApiController, ITransient
         var isExist = await _sysDictDataRep.IsAnyAsync(u => u.Id == input.Id);
         if (!isExist) throw Oops.Oh(ErrorCodeEnum.D3004);
 
-        isExist = await _sysDictDataRep.IsAnyAsync(u => (u.Value == input.Value || u.Code == input.Code) && u.DictTypeId == input.DictTypeId && u.Id != input.Id);
+        isExist = await _sysDictDataRep.IsAnyAsync(u => u.Code == input.Code && u.DictTypeId == input.DictTypeId && u.Id != input.Id);
         if (isExist) throw Oops.Oh(ErrorCodeEnum.D3003);
 
         await _sysDictDataRep.UpdateAsync(input.Adapt<SysDictData>());

+ 2 - 2
Admin.NET/Admin.NET.Core/Service/Dict/SysDictTypeService.cs

@@ -67,7 +67,7 @@ public class SysDictTypeService : IDynamicApiController, ITransient
     [DisplayName("添加字典类型")]
     public async Task AddDictType(AddDictTypeInput input)
     {
-        var isExist = await _sysDictTypeRep.IsAnyAsync(u => u.Name == input.Name || u.Code == input.Code);
+        var isExist = await _sysDictTypeRep.IsAnyAsync(u => u.Code == input.Code);
         if (isExist)
             throw Oops.Oh(ErrorCodeEnum.D3001);
 
@@ -87,7 +87,7 @@ public class SysDictTypeService : IDynamicApiController, ITransient
         if (!isExist)
             throw Oops.Oh(ErrorCodeEnum.D3000);
 
-        isExist = await _sysDictTypeRep.IsAnyAsync(u => (u.Name == input.Name || u.Code == input.Code) && u.Id != input.Id);
+        isExist = await _sysDictTypeRep.IsAnyAsync(u => u.Code == input.Code && u.Id != input.Id);
         if (isExist)
             throw Oops.Oh(ErrorCodeEnum.D3001);
 

+ 0 - 1
Admin.NET/Admin.NET.Core/Service/Logging/SysLogOpService.cs

@@ -58,7 +58,6 @@ public class SysLogOpService : IDynamicApiController, ITransient
 
         IExcelExporter excelExporter = new ExcelExporter();
         var res = await excelExporter.ExportAsByteArray(lopOpList);
-
         return new FileStreamResult(new MemoryStream(res), "application/octet-stream") { FileDownloadName = DateTime.Now.ToString("yyyyMMddHHmm") + "操作日志.xlsx" };
     }
 }

+ 5 - 5
Admin.NET/Admin.NET.Core/Service/Org/SysOrgService.cs

@@ -149,19 +149,19 @@ public class SysOrgService : IDynamicApiController, ITransient
             if (dataScopes.Count < 1 || !dataScopes.Contains(sysOrg.Id))
                 throw Oops.Oh(ErrorCodeEnum.D2003);
         }
-        
-        // 若机构为租户默认机构禁止删除
+
+        // 若机构为租户默认机构禁止删除
         var isTenantOrg = await _sysOrgRep.ChangeRepository<SqlSugarRepository<SysTenant>>()
             .IsAnyAsync(u => u.OrgId == input.Id);
         if (isTenantOrg)
             throw Oops.Oh(ErrorCodeEnum.D2008);
-        
+
         // 若机构有用户则禁止删除
         var orgHasEmp = await _sysOrgRep.ChangeRepository<SqlSugarRepository<SysUser>>()
             .IsAnyAsync(u => u.OrgId == input.Id);
         if (orgHasEmp)
             throw Oops.Oh(ErrorCodeEnum.D2004);
-        
+
         // 若扩展机构有用户则禁止删除
         var hasExtOrgEmp = await _sysUserExtOrgService.HasUserOrg(sysOrg.Id);
         if (hasExtOrgEmp)
@@ -170,7 +170,7 @@ public class SysOrgService : IDynamicApiController, ITransient
         // 若子机构有用户则禁止删除
         var orgTreeList = await _sysOrgRep.AsQueryable().ToChildListAsync(u => u.Pid, input.Id, true);
         var orgIdList = orgTreeList.Select(u => u.Id).ToList();
-        
+
         // 若子机构有用户则禁止删除
         var cOrgHasEmp = await _sysOrgRep.ChangeRepository<SqlSugarRepository<SysUser>>()
             .IsAnyAsync(u => orgIdList.Contains(u.OrgId));

+ 3 - 1
Admin.NET/Admin.NET.Core/Service/Wechat/SysWechatPayService.cs

@@ -28,12 +28,14 @@ public class SysWechatPayService : IDynamicApiController, ITransient
     /// <returns></returns>
     private WechatTenpayClient CreateTenpayClient()
     {
+        var cerFilePath = App.WebHostEnvironment.ContentRootPath + _wechatPayOptions.MerchantCertificatePrivateKey;
+
         var tenpayClientOptions = new WechatTenpayClientOptions()
         {
             MerchantId = _wechatPayOptions.MerchantId,
             MerchantV3Secret = _wechatPayOptions.MerchantV3Secret,
             MerchantCertificateSerialNumber = _wechatPayOptions.MerchantCertificateSerialNumber,
-            MerchantCertificatePrivateKey = File.ReadAllText(App.WebHostEnvironment.ContentRootPath + _wechatPayOptions.MerchantCertificatePrivateKey),
+            MerchantCertificatePrivateKey = File.Exists(cerFilePath) ? File.ReadAllText(cerFilePath) : "",
             PlatformCertificateManager = new InMemoryCertificateManager()
         };
         return new WechatTenpayClient(tenpayClientOptions);