Przeglądaj źródła

😁1、token增加机构类型 2、优化sqlsugar表列处理 3、增加请求参数长度限制设置 4、升级所有依赖

zuohuaijun 2 lat temu
rodzic
commit
588a91049d

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

@@ -19,9 +19,9 @@
     <PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
     <PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
     <PackageReference Include="FluentEmail.Smtp" Version="3.0.2" />
-    <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.8.30" />
-    <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.8.30" />
-    <PackageReference Include="Furion.Pure" Version="4.8.8.30" />
+    <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.8.33" />
+    <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.8.33" />
+    <PackageReference Include="Furion.Pure" Version="4.8.8.33" />
     <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.5" />

+ 5 - 0
Admin.NET/Admin.NET.Core/Const/ClaimConst.cs

@@ -45,6 +45,11 @@ public class ClaimConst
     /// </summary>
     public const string OrgName = "OrgName";
 
+    /// <summary>
+    /// 组织机构类型
+    /// </summary>
+    public const string OrgType = "OrgType";
+
     /// <summary>
     /// 微信OpenId
     /// </summary>

+ 5 - 0
Admin.NET/Admin.NET.Core/Service/Auth/Dto/LoginUserOutput.cs

@@ -45,6 +45,11 @@ public class LoginUserOutput
     /// </summary>
     public string OrgName { get; set; }
 
+    /// <summary>
+    /// 机构类型
+    /// </summary>
+    public string OrgType { get; set; }
+
     /// <summary>
     /// 职位名称
     /// </summary>

+ 2 - 0
Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs

@@ -100,6 +100,7 @@ public class SysAuthService : IDynamicApiController, ITransient
             { ClaimConst.AccountType, user.AccountType },
             { ClaimConst.OrgId, user.OrgId },
             { ClaimConst.OrgName, user.SysOrg?.Name },
+            { ClaimConst.OrgType, user.SysOrg?.OrgType },
         }, tokenExpire);
 
         // 生成刷新Token令牌
@@ -145,6 +146,7 @@ public class SysAuthService : IDynamicApiController, ITransient
             Signature = user.Signature,
             OrgId = user.OrgId,
             OrgName = org?.Name,
+            OrgType = org?.OrgType,
             PosName = pos?.Name,
             Buttons = buttons
         };

+ 6 - 4
Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs

@@ -42,15 +42,17 @@ public static class SqlSugarSetup
         {
             EntityNameService = (type, entity) => // 处理表
             {
-                if (!type.GetCustomAttributes<SqlSugar.SugarTable>().Any())
-                    return;//只需处理SugarTable实体
+                // 只处理贴了特性 SugarTable 表
+                if (!type.GetCustomAttributes<SugarTable>().Any())
+                    return;
                 if (config.EnableUnderLine && !entity.DbTableName.Contains('_'))
                     entity.DbTableName = UtilMethods.ToUnderLine(entity.DbTableName); // 驼峰转下划线
             },
             EntityService = (type, column) => // 处理列
             {
-                if (!type.GetCustomAttributes<SqlSugar.SugarColumn>().Any())
-                    return;//只需处理SugarColumn实体
+                // 只处理贴了特性 SugarColumn 列
+                if (!type.GetCustomAttributes<SugarColumn>().Any())
+                    return;
                 if (new NullabilityInfoContext().Create(type).WriteState is NullabilityState.Nullable)
                     column.IsNullable = true;
                 if (config.EnableUnderLine && !column.IsIgnore && !column.DbColumnName.Contains('_'))

+ 1 - 1
Admin.NET/Admin.NET.Web.Entry/web.config

@@ -4,7 +4,7 @@
 	<system.webServer>
 		<security>
 			<requestFiltering>
-				<requestLimits maxAllowedContentLength="1073741824" />
+				<requestLimits maxAllowedContentLength="1073741824" maxQueryString="1073741824" />
 			</requestFiltering>
 		</security>
 	</system.webServer>