diff --git a/api_sqlsugar/VolPro.Core/Utilities/VierificationCodeServices.cs b/api_sqlsugar/VolPro.Core/Utilities/VierificationCodeServices.cs index 87af353..6fd82c8 100644 --- a/api_sqlsugar/VolPro.Core/Utilities/VierificationCodeServices.cs +++ b/api_sqlsugar/VolPro.Core/Utilities/VierificationCodeServices.cs @@ -27,44 +27,46 @@ namespace VolPro.Core.Utilities canvas.Clear(SKColors.White); + // 从 fonts 文件夹加载字体文件(相对于运行目录) + string fontPath = Path.Combine(AppContext.BaseDirectory, "fonts", "DejaVuSans.ttf"); + if (!File.Exists(fontPath)) + throw new FileNotFoundException($"字体文件未找到: {fontPath}"); + + using var typeface = SKTypeface.FromFile(fontPath); + if (typeface == null) + throw new Exception($"无法从 {fontPath} 加载字体。"); + using var pen = new SKPaint(); pen.FakeBoldText = true; pen.Style = SKPaintStyle.Fill; - pen.TextSize = 20;// 0.6f * info.Width * pen.TextSize / pen.MeasureText(code); + pen.TextSize = 20; + pen.Typeface = typeface; // 使用加载的本地字体 - //绘制随机字符 + // 绘制随机字符 for (int i = 0; i < code.Length; i++) { - pen.Color = random.GetRandom(colors);//随机颜色索引值 - - pen.Typeface = SKTypeface.FromFamilyName("DejaVu Sans", 700, 20, SKFontStyleSlant.Italic);//配置字体 - var point = new SKPoint() + pen.Color = random.GetRandom(colors); // 假设 colors 是外部定义的静态颜色数组 + var point = new SKPoint { X = i * 16, - Y = 22// info.Height - ((i + 1) % 2 == 0 ? 2 : 4), - + Y = 22 }; - canvas.DrawText(code.Substring(i, 1), point, pen);//绘制一个验证字符 - + canvas.DrawText(code.Substring(i, 1), point, pen); } // 绘制噪点 var points = Enumerable.Range(0, 100).Select( _ => new SKPoint(random.Next(bitmap.Width), random.Next(bitmap.Height)) ).ToArray(); - canvas.DrawPoints( - SKPointMode.Points, - points, - pen); + canvas.DrawPoints(SKPointMode.Points, points, pen); - //绘制贝塞尔线条 + // 绘制贝塞尔线条(原有逻辑存在 p1~p4 全为零的问题,此处保留原样) for (int i = 0; i < 2; i++) { var p1 = new SKPoint(0, 0); var p2 = new SKPoint(0, 0); var p3 = new SKPoint(0, 0); var p4 = new SKPoint(0, 0); - var touchPoints = new SKPoint[] { p1, p2, p3, p4 }; using var bPen = new SKPaint(); @@ -76,8 +78,76 @@ namespace VolPro.Core.Utilities path.CubicTo(touchPoints[1], touchPoints[2], touchPoints[3]); canvas.DrawPath(path, bPen); } + return bitmap.ToBase64String(SKEncodedImageFormat.Png); } + //public static string CreateBase64Image(string code) + //{ + // var random = new Random(); + // var info = new SKImageInfo((int)code.Length * 18, 32); + // using var bitmap = new SKBitmap(info); + // using var canvas = new SKCanvas(bitmap); + + // canvas.Clear(SKColors.White); + + // using var pen = new SKPaint(); + // pen.FakeBoldText = true; + // pen.Style = SKPaintStyle.Fill; + // pen.TextSize = 20;// 0.6f * info.Width * pen.TextSize / pen.MeasureText(code); + + // // 检查 "DejaVu Sans" 字体是否存在 + // using var testTypeface = SKFontManager.Default.MatchFamily("DejaVu Sans"); + // if (testTypeface == null || string.IsNullOrEmpty(testTypeface.FamilyName)) + // { + // throw new Exception("系统中未找到 'DejaVu Sans' 字体。"); + // } + + // //绘制随机字符 + // for (int i = 0; i < code.Length; i++) + // { + // pen.Color = random.GetRandom(colors);//随机颜色索引值 + + // pen.Typeface = SKTypeface.FromFamilyName("DejaVu Sans", 700, 20, SKFontStyleSlant.Italic);//配置字体 + // var point = new SKPoint() + // { + // X = i * 16, + // Y = 22// info.Height - ((i + 1) % 2 == 0 ? 2 : 4), + + // }; + // canvas.DrawText(code.Substring(i, 1), point, pen);//绘制一个验证字符 + + // } + + // // 绘制噪点 + // var points = Enumerable.Range(0, 100).Select( + // _ => new SKPoint(random.Next(bitmap.Width), random.Next(bitmap.Height)) + // ).ToArray(); + // canvas.DrawPoints( + // SKPointMode.Points, + // points, + // pen); + + // //绘制贝塞尔线条 + // for (int i = 0; i < 2; i++) + // { + // var p1 = new SKPoint(0, 0); + // var p2 = new SKPoint(0, 0); + // var p3 = new SKPoint(0, 0); + // var p4 = new SKPoint(0, 0); + + // var touchPoints = new SKPoint[] { p1, p2, p3, p4 }; + + // using var bPen = new SKPaint(); + // bPen.Color = random.GetRandom(colors); + // bPen.Style = SKPaintStyle.Stroke; + + // using var path = new SKPath(); + // path.MoveTo(touchPoints[0]); + // path.CubicTo(touchPoints[1], touchPoints[2], touchPoints[3]); + // canvas.DrawPath(path, bPen); + // } + // return bitmap.ToBase64String(SKEncodedImageFormat.Png); + //} public static T GetRandom(this Random random, T[] tArray) { diff --git a/api_sqlsugar/VolPro.WebApi/Download/Logger/Queue/WriteError/20260521.txt b/api_sqlsugar/VolPro.WebApi/Download/Logger/Queue/WriteError/20260521.txt new file mode 100644 index 0000000..d23dbec --- /dev/null +++ b/api_sqlsugar/VolPro.WebApi/Download/Logger/Queue/WriteError/20260521.txt @@ -0,0 +1,7 @@ +中文提示 : 检测到你没有开启文件,AllowLoadLocalInfile=true加到自符串上,已自动执行 SET GLOBAL local_infile=1 在试一次 +English Message : Loading local data is disabled; this must be enabled on both the client and server sides at SqlSugar.Check.ExceptionEasy(String enMessage, String cnMessage) + at SqlSugar.MySqlFastBuilder.ExecuteBulkCopyAsync(DataTable dt) + at SqlSugar.FastestProvider`1._BulkCopy(List`1 datas) + at SqlSugar.FastestProvider`1.BulkCopyAsync(List`1 datas) + at SqlSugar.FastestProvider`1.BulkCopy(List`1 datas) + at VolPro.Core.Services.Logger.Start() in D:\Code\SecMPS\api_sqlsugar\VolPro.Core\Services\Logger.cs:line 194SqlSugar diff --git a/api_sqlsugar/VolPro.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml b/api_sqlsugar/VolPro.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml index 002f161..e7b7a03 100644 --- a/api_sqlsugar/VolPro.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml +++ b/api_sqlsugar/VolPro.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml @@ -4,13 +4,18 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - False - False - True + true + false + true Release Any CPU FileSystem bin\Release\netcoreapp3.1\net6.0\publish\ FileSystem + + net8.0 + linux-arm64 + 4db3c91b-93fe-4937-8b58-ddd3f57d4607 + true \ No newline at end of file diff --git a/api_sqlsugar/VolPro.WebApi/VolPro.WebApi.csproj b/api_sqlsugar/VolPro.WebApi/VolPro.WebApi.csproj index 92dbb4e..e2c02dc 100644 --- a/api_sqlsugar/VolPro.WebApi/VolPro.WebApi.csproj +++ b/api_sqlsugar/VolPro.WebApi/VolPro.WebApi.csproj @@ -59,5 +59,11 @@ + + + Always + + + diff --git a/api_sqlsugar/VolPro.WebApi/fonts/DejaVuSans.ttf b/api_sqlsugar/VolPro.WebApi/fonts/DejaVuSans.ttf new file mode 100644 index 0000000..5267218 Binary files /dev/null and b/api_sqlsugar/VolPro.WebApi/fonts/DejaVuSans.ttf differ diff --git a/doc/error/KMS_error_20260519.txt b/doc/error/KMS_error_20260519.txt new file mode 100644 index 0000000..e9d6ec4 --- /dev/null +++ b/doc/error/KMS_error_20260519.txt @@ -0,0 +1,3 @@ +严重性 代码 说明 项目 文件 行 抑制状态 详细信息 +错误(活动) CS1061 “ControlRequest”未包含“Command”的定义,并且找不到可接受第一个“ControlRequest”类型参数的可访问扩展方法“Command”(是否缺少 using 指令或程序集引用?) IntegrationGateway.Host D:\Code\SecMPS\gateway\src\IntegrationGateway.Host\Program.cs 213 +错误(活动) CS1061 “ControlRequest”未包含“Parameters”的定义,并且找不到可接受第一个“ControlRequest”类型参数的可访问扩展方法“Parameters”(是否缺少 using 指令或程序集引用?) IntegrationGateway.Host D:\Code\SecMPS\gateway\src\IntegrationGateway.Host\Program.cs 213 diff --git a/gateway/NuGet.Config b/gateway/NuGet.Config index 765346e..a7eb4ed 100644 --- a/gateway/NuGet.Config +++ b/gateway/NuGet.Config @@ -1,7 +1,8 @@ - + + diff --git a/gateway/src/IntegrationGateway.Host/Properties/PublishProfiles/FolderProfile.pubxml b/gateway/src/IntegrationGateway.Host/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 0000000..66f2ae6 --- /dev/null +++ b/gateway/src/IntegrationGateway.Host/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,20 @@ + + + + + false + false + true + Release + Any CPU + FileSystem + bin\Release\net8.0\publish\ + FileSystem + <_TargetId>Folder + + net8.0 + linux-arm64 + 6d56687b-d31c-6b60-3205-966929747297 + true + + \ No newline at end of file diff --git a/gateway/src/IntegrationGateway.Host/dotnet-tools.json b/gateway/src/IntegrationGateway.Host/dotnet-tools.json new file mode 100644 index 0000000..7dcefc3 --- /dev/null +++ b/gateway/src/IntegrationGateway.Host/dotnet-tools.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-ef": { + "version": "10.0.8", + "commands": [ + "dotnet-ef" + ], + "rollForward": false + } + } +} \ No newline at end of file diff --git a/warehouse/public/apiConfig.js b/warehouse/public/apiConfig.js index ed85e0f..8687d0b 100644 --- a/warehouse/public/apiConfig.js +++ b/warehouse/public/apiConfig.js @@ -2,15 +2,15 @@ window.apiConfig = { // 根据环境变量配置不同的基础URL baseURL: { - development: 'http://localhost:9100/', - debug: 'http://localhost:9100/', - production: 'http://localhost:9100/' + development: 'http://192.168.3.108:9100/', + debug: 'http://192.168.3.108:9100/', + production: 'http://192.168.3.108:9100/' }, // 大屏地址配置 dataViewUrl: { - development: 'http://localhost:9200/', - debug: 'http://localhost:9200/', // 调试环境也使用相同配置 - production: 'http://localhost:9200/' + development: 'http://192.168.3.108:9200/', + debug: 'http://192.168.3.108:9200/', // 调试环境也使用相同配置 + production: 'http://192.168.3.108:9200/' }, // API路径配置 apiPaths: { diff --git a/warehouse/src/api/gateway.ts b/warehouse/src/api/gateway.ts index 585b20e..509a872 100644 --- a/warehouse/src/api/gateway.ts +++ b/warehouse/src/api/gateway.ts @@ -3,7 +3,7 @@ * 所有网关 API 调用使用 fetch() 直连,不走 Vol.Pro 后端中转 */ -const GW_BASE = 'http://localhost:5100' +const GW_BASE = 'http://192.168.3.108:5100' /** GET 请求网关 */ export async function gwGet(url: string): Promise { diff --git a/warehouse/src/api/http.js b/warehouse/src/api/http.js index c4d75c3..3b4cec9 100644 --- a/warehouse/src/api/http.js +++ b/warehouse/src/api/http.js @@ -22,7 +22,7 @@ if (apiConfig.baseURL && apiConfig.baseURL[env]) { axios.defaults.baseURL = apiConfig.baseURL[env]; } else { // 降级方案,确保系统能正常运行 - axios.defaults.baseURL = 'http://localhost:9100/'; + axios.defaults.baseURL = 'http://192.168.3.108:9100/'; } // 设置大屏地址 @@ -30,10 +30,10 @@ if (apiConfig.dataViewUrl && apiConfig.dataViewUrl[env]) { dataViewUrl = apiConfig.dataViewUrl[env]; } else { // 降级方案,确保系统能正常运行 - dataViewUrl = 'http://localhost:9200/'; + dataViewUrl = 'http://192.168.3.108:9200/'; } //后台接口地址 - //axios.defaults.baseURL = 'http://localhost:9100/' + //axios.defaults.baseURL = 'http://192.168.3.108:9100/' if (!axios.defaults.baseURL.endsWith('/')) { axios.defaults.baseURL += '/' }