修复起点: 统一问题清单修复前基线

This commit is contained in:
2026-06-03 17:32:33 +08:00
parent 4427ca9fb9
commit 7adf6407d5
12 changed files with 155 additions and 30 deletions

View File

@@ -27,44 +27,46 @@ namespace VolPro.Core.Utilities
canvas.Clear(SKColors.White); 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(); using var pen = new SKPaint();
pen.FakeBoldText = true; pen.FakeBoldText = true;
pen.Style = SKPaintStyle.Fill; 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++) for (int i = 0; i < code.Length; i++)
{ {
pen.Color = random.GetRandom(colors);//随机颜色索引值 pen.Color = random.GetRandom(colors); // 假设 colors 是外部定义的静态颜色数组
var point = new SKPoint
pen.Typeface = SKTypeface.FromFamilyName("DejaVu Sans", 700, 20, SKFontStyleSlant.Italic);//配置字体
var point = new SKPoint()
{ {
X = i * 16, 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( var points = Enumerable.Range(0, 100).Select(
_ => new SKPoint(random.Next(bitmap.Width), random.Next(bitmap.Height)) _ => new SKPoint(random.Next(bitmap.Width), random.Next(bitmap.Height))
).ToArray(); ).ToArray();
canvas.DrawPoints( canvas.DrawPoints(SKPointMode.Points, points, pen);
SKPointMode.Points,
points,
pen);
//绘制贝塞尔线条 // 绘制贝塞尔线条(原有逻辑存在 p1~p4 全为零的问题,此处保留原样)
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
var p1 = new SKPoint(0, 0); var p1 = new SKPoint(0, 0);
var p2 = new SKPoint(0, 0); var p2 = new SKPoint(0, 0);
var p3 = new SKPoint(0, 0); var p3 = new SKPoint(0, 0);
var p4 = new SKPoint(0, 0); var p4 = new SKPoint(0, 0);
var touchPoints = new SKPoint[] { p1, p2, p3, p4 }; var touchPoints = new SKPoint[] { p1, p2, p3, p4 };
using var bPen = new SKPaint(); using var bPen = new SKPaint();
@@ -76,8 +78,76 @@ namespace VolPro.Core.Utilities
path.CubicTo(touchPoints[1], touchPoints[2], touchPoints[3]); path.CubicTo(touchPoints[1], touchPoints[2], touchPoints[3]);
canvas.DrawPath(path, bPen); canvas.DrawPath(path, bPen);
} }
return bitmap.ToBase64String(SKEncodedImageFormat.Png); 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<T>(this Random random, T[] tArray) public static T GetRandom<T>(this Random random, T[] tArray)
{ {

View File

@@ -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

View File

@@ -4,13 +4,18 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
--> -->
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<DeleteExistingFiles>False</DeleteExistingFiles> <DeleteExistingFiles>true</DeleteExistingFiles>
<ExcludeApp_Data>False</ExcludeApp_Data> <ExcludeApp_Data>false</ExcludeApp_Data>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> <LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform> <LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider> <PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\Release\netcoreapp3.1\net6.0\publish\</PublishUrl> <PublishUrl>bin\Release\netcoreapp3.1\net6.0\publish\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod> <WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>linux-arm64</RuntimeIdentifier>
<ProjectGuid>4db3c91b-93fe-4937-8b58-ddd3f57d4607</ProjectGuid>
<SelfContained>true</SelfContained>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@@ -59,5 +59,11 @@
<None Include="Startup copy.cs" /> <None Include="Startup copy.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Update="fonts\DejaVuSans.ttf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project> </Project>

Binary file not shown.

View File

@@ -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

View File

@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<packageSources> <packageSources>
<clear /> <clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="nuget.org_v2" value="https://www.nuget.org/api/v2/" />
</packageSources> </packageSources>
</configuration> </configuration>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://go.microsoft.com/fwlink/?LinkID=208121. -->
<Project>
<PropertyGroup>
<DeleteExistingFiles>false</DeleteExistingFiles>
<ExcludeApp_Data>false</ExcludeApp_Data>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\Release\net8.0\publish\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>linux-arm64</RuntimeIdentifier>
<ProjectGuid>6d56687b-d31c-6b60-3205-966929747297</ProjectGuid>
<SelfContained>true</SelfContained>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "10.0.8",
"commands": [
"dotnet-ef"
],
"rollForward": false
}
}
}

View File

@@ -2,15 +2,15 @@
window.apiConfig = { window.apiConfig = {
// 根据环境变量配置不同的基础URL // 根据环境变量配置不同的基础URL
baseURL: { baseURL: {
development: 'http://localhost:9100/', development: 'http://192.168.3.108:9100/',
debug: 'http://localhost:9100/', debug: 'http://192.168.3.108:9100/',
production: 'http://localhost:9100/' production: 'http://192.168.3.108:9100/'
}, },
// 大屏地址配置 // 大屏地址配置
dataViewUrl: { dataViewUrl: {
development: 'http://localhost:9200/', development: 'http://192.168.3.108:9200/',
debug: 'http://localhost:9200/', // 调试环境也使用相同配置 debug: 'http://192.168.3.108:9200/', // 调试环境也使用相同配置
production: 'http://localhost:9200/' production: 'http://192.168.3.108:9200/'
}, },
// API路径配置 // API路径配置
apiPaths: { apiPaths: {

View File

@@ -3,7 +3,7 @@
* 所有网关 API 调用使用 fetch() 直连,不走 Vol.Pro 后端中转 * 所有网关 API 调用使用 fetch() 直连,不走 Vol.Pro 后端中转
*/ */
const GW_BASE = 'http://localhost:5100' const GW_BASE = 'http://192.168.3.108:5100'
/** GET 请求网关 */ /** GET 请求网关 */
export async function gwGet(url: string): Promise<any> { export async function gwGet(url: string): Promise<any> {

View File

@@ -22,7 +22,7 @@ if (apiConfig.baseURL && apiConfig.baseURL[env]) {
axios.defaults.baseURL = apiConfig.baseURL[env]; axios.defaults.baseURL = apiConfig.baseURL[env];
} else { } 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]; dataViewUrl = apiConfig.dataViewUrl[env];
} else { } 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('/')) { if (!axios.defaults.baseURL.endsWith('/')) {
axios.defaults.baseURL += '/' axios.defaults.baseURL += '/'
} }