Ver código fonte

😘1、修复实体与表名不对应的问题 2、增加Dockerfile文件 3、升级nuget包 !525

zuohuaijun 3 anos atrás
pai
commit
a5040848b8

+ 25 - 0
Admin.NET/.dockerignore

@@ -0,0 +1,25 @@
+**/.classpath
+**/.dockerignore
+**/.env
+**/.git
+**/.gitignore
+**/.project
+**/.settings
+**/.toolstarget
+**/.vs
+**/.vscode
+**/*.*proj.user
+**/*.dbmdl
+**/*.jfm
+**/azds.yaml
+**/bin
+**/charts
+**/docker-compose*
+**/Dockerfile*
+**/node_modules
+**/npm-debug.log
+**/obj
+**/secrets.dev.yaml
+**/values.dev.yaml
+LICENSE
+README.md

+ 1 - 1
Admin.NET/Admin.NET.Application/Configuration/App.json

@@ -1,7 +1,7 @@
 {
     "$schema": "https://gitee.com/dotnetchina/Furion/raw/net6/schemas/v3/furion-schema.json",
 
-    //"Urls": "https://*:5005",
+    "Urls": "http://*:5050",
 
     "AllowedHosts": "*",
 

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

@@ -20,9 +20,9 @@
     <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.3.10" />
     <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.3.10" />
     <PackageReference Include="Furion.Pure" Version="4.8.3.10" />
-    <PackageReference Include="Lazy.Captcha.Core" Version="1.1.6" />
-    <PackageReference Include="Magicodes.IE.Excel" Version="2.7.2" />
-    <PackageReference Include="Magicodes.IE.Pdf" Version="2.7.2" />
+    <PackageReference Include="Lazy.Captcha.Core" Version="2.0.0" />
+    <PackageReference Include="Magicodes.IE.Excel" Version="2.7.3" />
+    <PackageReference Include="Magicodes.IE.Pdf" Version="2.7.3" />
     <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.12" />
     <PackageReference Include="NEST" Version="7.17.5" />
     <PackageReference Include="NETCore.MailKit" Version="2.1.0" />
@@ -30,7 +30,7 @@
     <PackageReference Include="OnceMi.AspNetCore.OSS" Version="1.1.9" />
     <PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="2.21.1" />
     <PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="2.15.2" />
-    <PackageReference Include="SqlSugarCore" Version="5.1.3.42-preview07" />
+    <PackageReference Include="SqlSugarCore" Version="5.1.3.42" />
     <PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.24" />
     <PackageReference Include="UAParser" Version="3.1.47" />
     <PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />

+ 2 - 1
Admin.NET/Admin.NET.Core/Captcha/LazyCaptchaSetup.cs

@@ -1,6 +1,7 @@
 using Lazy.Captcha.Core;
 using Lazy.Captcha.Core.Generator;
 using Lazy.Captcha.Core.Storage;
+using SkiaSharp;
 
 namespace Admin.NET.Core;
 
@@ -70,7 +71,7 @@ public class RandomCaptcha : DefaultCaptcha
         //options.ImageOption.BubbleMaxRadius = 15; // 气泡最大半径
         //options.ImageOption.BubbleThickness = 1; // 气泡边沿厚度
 
-        options.ImageOption.BackgroundColor = SixLabors.ImageSharp.Color.White; // 背景色
+        options.ImageOption.BackgroundColor = SKColors.White; // 背景色
 
         options.ImageOption.Width = 150; // 验证码宽度
         options.ImageOption.Height = 50; // 验证码高度

+ 4 - 2
Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenService.cs

@@ -126,13 +126,15 @@ public class SysCodeGenService : IDynamicApiController, ITransient
         var provider = _db.AsTenant().GetConnectionScope(configId);
         var dbTableInfos = provider.DbMaintenance.GetTableInfoList(false); // 不能走缓存,否则切库不起作用
 
+        var config = App.GetOptions<DbConnectionOptions>().ConnectionConfigs.FirstOrDefault(u => u.ConfigId == configId);
+
         var dbTableNames = dbTableInfos.Select(u => u.Name).ToList();
         IEnumerable<EntityInfo> entityInfos = await _commonService.GetEntityInfos();
-        return entityInfos.Where(u => dbTableNames.Contains(UtilMethods.ToUnderLine(u.DbTableName))).Select(u => new TableOutput()
+        return entityInfos.Where(u => dbTableNames.Contains(config.EnableUnderLine ? UtilMethods.ToUnderLine(u.DbTableName) : u.DbTableName)).Select(u => new TableOutput()
         {
             ConfigId = configId,
             EntityName = u.EntityName,
-            TableName = UtilMethods.ToUnderLine(u.DbTableName),
+            TableName = config.EnableUnderLine ? UtilMethods.ToUnderLine(u.DbTableName) : u.DbTableName,
             TableComment = u.TableDescription
         }).ToList();
     }

+ 6 - 0
Admin.NET/Admin.NET.Web.Entry/Admin.NET.Web.Entry.csproj

@@ -5,6 +5,8 @@
 		<ImplicitUsings>enable</ImplicitUsings>
 		<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
 		<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
+		<UserSecretsId>ad9369d1-f29b-4f8f-a7df-8b4d7aa0726b</UserSecretsId>
+		<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
 	</PropertyGroup>
 
 	<ItemGroup>
@@ -28,6 +30,10 @@
 	  <EmbeddedResource Include="sensitive-words.txt" />
 	</ItemGroup>
 
+	<ItemGroup>
+	  <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
+	</ItemGroup>
+
 	<ItemGroup>
 		<ProjectReference Include="..\Admin.NET.Web.Core\Admin.NET.Web.Core.csproj" />
 	</ItemGroup>

+ 6 - 0
Admin.NET/Admin.NET.Web.Entry/Dockerfile

@@ -0,0 +1,6 @@
+FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
+WORKDIR /app
+EXPOSE 5050
+
+COPY . .
+ENTRYPOINT ["dotnet", "Admin.NET.Web.Entry.dll"]

+ 32 - 27
Admin.NET/Admin.NET.Web.Entry/Properties/launchSettings.json

@@ -1,30 +1,35 @@
-{
-    "iisSettings": {
-        "windowsAuthentication": false,
-        "anonymousAuthentication": true,
-        "iisExpress": {
-            "applicationUrl": "https://localhost:44326",
-            "sslPort": 44326
-        }
+{
+  "profiles": {
+    "IIS Express": {
+      "commandName": "IISExpress",
+      "launchBrowser": true,
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      }
     },
-    "profiles": {
-        "IIS Express": {
-            "commandName": "IISExpress",
-            "launchBrowser": true,
-            "launchUrl": "",
-            "environmentVariables": {
-                "ASPNETCORE_ENVIRONMENT": "Development"
-            }
-        },
-        "Admin.NET.Web.Entry": {
-            "commandName": "Project",
-            "dotnetRunMessages": "true",
-            "launchBrowser": true,
-            "launchUrl": "",
-            "applicationUrl": "https://localhost:44326;http://localhost:5000",
-            "environmentVariables": {
-                "ASPNETCORE_ENVIRONMENT": "Development"
-            }
-        }
+    "Admin.NET.Web.Entry": {
+      "commandName": "Project",
+      "launchBrowser": true,
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      },
+      "dotnetRunMessages": true,
+      "applicationUrl": "https://localhost:44326;http://localhost:5000"
+    },
+    "Docker": {
+      "commandName": "Docker",
+      "launchBrowser": true,
+      "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
+      "publishAllPorts": true,
+      "useSSL": true
+    }
+  },
+  "iisSettings": {
+    "windowsAuthentication": false,
+    "anonymousAuthentication": true,
+    "iisExpress": {
+      "applicationUrl": "https://localhost:44326",
+      "sslPort": 44326
     }
+  }
 }