Просмотр исходного кода

修复初始化生成种子数据

zuohuaijun 3 лет назад
Родитель
Сommit
8a06bdd2e9

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

@@ -24,7 +24,7 @@
 
   <ItemGroup>
     <PackageReference Include="AspNetCoreRateLimit" Version="4.0.2" />
-    <PackageReference Include="Caching.CSRedis" Version="3.8.668" />
+    <PackageReference Include="Caching.CSRedis" Version="3.8.669" />
     <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.4.3" />
     <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.4.3" />
     <PackageReference Include="Furion.Pure" Version="4.4.3" />

+ 1 - 1
Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs

@@ -204,7 +204,7 @@ public static class SqlSugarSetup
                 //// 如果添加一条种子数,sqlsugar 默认以 @param 的方式赋值,如果 PropertyType 为空,则默认数据类型为字符串。插入 pgsql 时候会报错,所以要忽略为空的值添加
                 //_ = ((InsertableProvider<Dictionary<string, object>>)storage.AsInsertable).IsSingle ?
                 //    storage.AsInsertable.IgnoreColumns("UpdateTime", "UpdateUserId", "CreateUserId").ExecuteCommand() :
-                //    storage.AsInsertable.ExecuteCommand();
+                storage.AsInsertable.ExecuteCommand();
                 storage.AsUpdateable.ExecuteCommand();
             }
             else // 没有主键或者不是预定义的主键(没主键有重复的可能)

+ 14 - 11
Admin.NET/Admin.NET.Web.Core/Startup.cs

@@ -39,16 +39,6 @@ public class Startup : AppStartup
         //services.AddMvcFilter<ResultFilter>();
         // 日志监听
         services.AddMonitorLogging();
-        // 第三方授权登录
-        services.AddAuthentication()
-            .AddWeixin(options =>
-            {
-                var opt = App.GetOptions<OAuthOptions>();
-                options.ClientId = opt.Weixin.ClientId;
-                options.ClientSecret = opt.Weixin.ClientSecret;
-            });
-        // ElasticSearch
-        services.AddElasticSearch();
 
         services.AddControllersWithViews()
             .AddAppLocalization()
@@ -63,9 +53,22 @@ public class Startup : AppStartup
 
         // 缓存注册
         services.AddCache();
+
         // SqlSugar
         services.AddSqlSugar();
 
+        // 第三方授权登录
+        services.AddAuthentication()
+            .AddWeixin(options =>
+            {
+                var opt = App.GetOptions<OAuthOptions>();
+                options.ClientId = opt.Weixin.ClientId;
+                options.ClientSecret = opt.Weixin.ClientSecret;
+            });
+
+        // ElasticSearch
+        services.AddElasticSearch();
+
         // 配置Nginx转发获取客户端真实IP
         // 注1:如果负载均衡不是在本机通过 Loopback 地址转发请求的,一定要加上options.KnownNetworks.Clear()和options.KnownProxies.Clear()
         // 注2:如果设置环境变量 ASPNETCORE_FORWARDEDHEADERS_ENABLED 为 True,则不需要下面的配置代码
@@ -144,7 +147,7 @@ public class Startup : AppStartup
             services.AddDatabaseLogging<ElasticSearchLoggingWriter>();
         }
 
-        // 置雪花Id算法机器码
+        // 置雪花Id算法机器码
         YitIdHelper.SetIdGenerator(new IdGeneratorOptions
         {
             WorkerId = App.GetOptions<SnowIdOptions>().WorkerId