diff --git "a/.Net6\347\211\210\346\234\254/.dockerignore" "b/.Net6\347\211\210\346\234\254/.dockerignore"
new file mode 100644
index 0000000000000000000000000000000000000000..3729ff0cd1acce411e814ec416b82ac0f239a4e0
--- /dev/null
+++ "b/.Net6\347\211\210\346\234\254/.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
\ No newline at end of file
diff --git "a/.Net6\347\211\210\346\234\254/VOL.AppManager/VOL.AppManager.csproj" "b/.Net6\347\211\210\346\234\254/VOL.AppManager/VOL.AppManager.csproj"
index 5c93ecb8c5eb193f18cc6357c09fb66be6714157..097685774f1aebb16a1a21956115ece1407586f7 100644
--- "a/.Net6\347\211\210\346\234\254/VOL.AppManager/VOL.AppManager.csproj"
+++ "b/.Net6\347\211\210\346\234\254/VOL.AppManager/VOL.AppManager.csproj"
@@ -18,10 +18,10 @@
-
-
-
-
+
+
+
+
diff --git "a/.Net6\347\211\210\346\234\254/VOL.Builder/Services/Core/Partial/Sys_TableInfoService.cs" "b/.Net6\347\211\210\346\234\254/VOL.Builder/Services/Core/Partial/Sys_TableInfoService.cs"
index b84eaf414bd952539cb069798981c8f868c3186f..5d5f524616d7ed35a26d822f646f73cf67c7ac1d 100644
--- "a/.Net6\347\211\210\346\234\254/VOL.Builder/Services/Core/Partial/Sys_TableInfoService.cs"
+++ "b/.Net6\347\211\210\346\234\254/VOL.Builder/Services/Core/Partial/Sys_TableInfoService.cs"
@@ -1543,17 +1543,22 @@ DISTINCT
StringBuilder AttributeBuilder = new StringBuilder();
sysColumn = sysColumn.OrderByDescending(c => c.OrderNo).ToList();
bool addIgnore = false;
+ int SpaceLenOfIndented = 7;
foreach (Sys_TableColumn column in sysColumn)
{
column.ColumnType = (column.ColumnType ?? "").Trim();
AttributeBuilder.Append("/// ");
AttributeBuilder.Append("\r\n");
- AttributeBuilder.Append(" ///" + column.ColumnCnName + "");
+ AttributeBuilder.Append(' ',SpaceLenOfIndented);
+ AttributeBuilder.Append("///" + column.ColumnCnName + "");
AttributeBuilder.Append("\r\n");
- AttributeBuilder.Append(" /// ");
+ AttributeBuilder.Append(' ',SpaceLenOfIndented);
+ AttributeBuilder.Append("/// ");
AttributeBuilder.Append("\r\n");
- if (column.IsKey == 1) { AttributeBuilder.Append(@" [Key]" + ""); AttributeBuilder.Append("\r\n"); }
- AttributeBuilder.Append(" [Display(Name =\"" + (
+ if (column.IsKey == 1) { AttributeBuilder.Append(' ',SpaceLenOfIndented);
+ AttributeBuilder.Append(@"[Key]" + ""); AttributeBuilder.Append("\r\n"); }
+ AttributeBuilder.Append(' ',SpaceLenOfIndented);
+ AttributeBuilder.Append("[Display(Name =\"" + (
string.IsNullOrEmpty(column.ColumnCnName) ? column.ColumnName : column.ColumnCnName
) + "\")]");
AttributeBuilder.Append("\r\n");
@@ -1568,14 +1573,16 @@ DISTINCT
if (column.ColumnType == "string" && column.Maxlength > 0 && column.Maxlength < 8000)
{
- AttributeBuilder.Append(" [MaxLength(" + column.Maxlength + ")]");
+ AttributeBuilder.Append(' ',SpaceLenOfIndented);
+ AttributeBuilder.Append("[MaxLength(" + column.Maxlength + ")]");
AttributeBuilder.Append("\r\n");
}
//不是数据列的,返回页面数据前不包含此列的数据
if (column.IsColumnData == 0 && createType == 1)
{
addIgnore = true;
- AttributeBuilder.Append(" [JsonIgnore]");
+ AttributeBuilder.Append(' ',SpaceLenOfIndented);
+ AttributeBuilder.Append("[JsonIgnore]");
AttributeBuilder.Append("\r\n");
}
//[Column(TypeName="bigint")]如果与字段类型不同会产生异常
@@ -1584,7 +1591,8 @@ DISTINCT
{
if (!string.IsNullOrEmpty(tableColumnInfo.Prec_Scale) && !tableColumnInfo.Prec_Scale.EndsWith(",0"))
{
- AttributeBuilder.Append(" [DisplayFormat(DataFormatString=\"" + tableColumnInfo.Prec_Scale + "\")]");
+ AttributeBuilder.Append(' ',SpaceLenOfIndented);
+ AttributeBuilder.Append("[DisplayFormat(DataFormatString=\"" + tableColumnInfo.Prec_Scale + "\")]");
AttributeBuilder.Append("\r\n");
}
@@ -1614,7 +1622,8 @@ DISTINCT
}
}
- AttributeBuilder.Append(" [Column(TypeName=\"" + tableColumnInfo.ColumnType + maxLength + "\")]");
+ AttributeBuilder.Append(' ',SpaceLenOfIndented);
+ AttributeBuilder.Append("[Column(TypeName=\"" + tableColumnInfo.ColumnType + maxLength + "\")]");
AttributeBuilder.Append("\r\n");
@@ -1631,13 +1640,15 @@ DISTINCT
if (column.EditRowNo != null)
{
- AttributeBuilder.Append(" [Editable(true)]");
+ AttributeBuilder.Append(' ',SpaceLenOfIndented);
+ AttributeBuilder.Append("[Editable(true)]");
AttributeBuilder.Append("\r\n");
}
// && column.ColumnType.ToLower() == "string"
if (column.IsNull == 0 || (createType == 2 && column.ApiIsNull == 0))
{
- AttributeBuilder.Append(" [Required(AllowEmptyStrings=false)]");
+ AttributeBuilder.Append(' ',SpaceLenOfIndented);
+ AttributeBuilder.Append("[Required(AllowEmptyStrings=false)]");
AttributeBuilder.Append("\r\n");
}
string columnType = (column.ColumnType == "Date" ? "DateTime" : column.ColumnType).Trim();
@@ -1658,7 +1669,8 @@ DISTINCT
{
columnType = "Guid" + (column.IsNull == 1 ? "?" : "");
}
- AttributeBuilder.Append(" public " + columnType + " " + column.ColumnName + " { get; set; }");
+ AttributeBuilder.Append(' ',SpaceLenOfIndented);
+ AttributeBuilder.Append("public " + columnType + " " + column.ColumnName + " { get; set; }");
AttributeBuilder.Append("\r\n\r\n ");
}
if (!string.IsNullOrEmpty(tableInfo.DetailName) && createType == 1)
diff --git "a/.Net6\347\211\210\346\234\254/VOL.Builder/VOL.Builder.csproj" "b/.Net6\347\211\210\346\234\254/VOL.Builder/VOL.Builder.csproj"
index 6041173809c5ac68e56171b2e471cf4408db37a0..a60fa44d0b5dc6f2486481bc2c31d2576439db4c 100644
--- "a/.Net6\347\211\210\346\234\254/VOL.Builder/VOL.Builder.csproj"
+++ "b/.Net6\347\211\210\346\234\254/VOL.Builder/VOL.Builder.csproj"
@@ -17,11 +17,11 @@
-
-
-
-
-
+
+
+
+
+
diff --git "a/.Net6\347\211\210\346\234\254/VOL.Core/Utilities/VierificationCode.cs" "b/.Net6\347\211\210\346\234\254/VOL.Core/Utilities/VierificationCode.cs"
index 2e3f75060613525c323b4d2b84dc235379bc4a2e..b9861191cf8bc29cf72e286cbe7d1ec6d23fb908 100644
--- "a/.Net6\347\211\210\346\234\254/VOL.Core/Utilities/VierificationCode.cs"
+++ "b/.Net6\347\211\210\346\234\254/VOL.Core/Utilities/VierificationCode.cs"
@@ -1,9 +1,8 @@
using System;
-using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
-using System.Text;
+using System.Runtime.Versioning;
namespace VOL.Core.Utilities
{
@@ -31,6 +30,8 @@ namespace VOL.Core.Utilities
}
return code;
}
+ [SupportedOSPlatform("Windows")]
+ [Obsolete("仅在 Windows 上支持 System.Drawing.Common,具体请参考:https://docs.microsoft.com/zh-cn/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only")]
public static string CreateBase64Imgage(string code)
{
Random random = new Random();
@@ -64,12 +65,11 @@ namespace VOL.Core.Utilities
}
g.DrawString(code.Substring(i, 1), f, b, 3 + (i * 12), ii);//绘制一个验证字符
}
- using (MemoryStream stream = new MemoryStream())
- {
- img.Save(stream, ImageFormat.Jpeg);
- byte[] b = stream.ToArray();
- return Convert.ToBase64String(stream.ToArray());
- }
+
+ using var stream = new MemoryStream();
+ img.Save(stream, ImageFormat.Jpeg);
+ stream.TryGetBuffer(out ArraySegment buffer);
+ return Convert.ToBase64String(buffer.Array);
}
}
}
diff --git "a/.Net6\347\211\210\346\234\254/VOL.Core/Utilities/VierificationCodeHelpers.cs" "b/.Net6\347\211\210\346\234\254/VOL.Core/Utilities/VierificationCodeHelpers.cs"
new file mode 100644
index 0000000000000000000000000000000000000000..3bd2ebfe0cd9fc6226251aecaa4ec83f9f2fe9e8
--- /dev/null
+++ "b/.Net6\347\211\210\346\234\254/VOL.Core/Utilities/VierificationCodeHelpers.cs"
@@ -0,0 +1,79 @@
+using System;
+using System.IO;
+using System.Linq;
+using SkiaSharp;
+
+namespace VOL.Core.Utilities;
+
+public static class VierificationCodeHelpers
+{ //验证码字体集合
+ private static readonly string[] fonts = { "Verdana", "Microsoft Sans Serif", "Comic Sans MS", "Arial", "宋体" };
+
+ public static string CreateBase64Image(string code)
+ {
+ var random = new Random();
+ var c = new SKColor[] { SKColors.Black, SKColors.Red, SKColors.DarkBlue, SKColors.Green, SKColors.Orange, SKColors.Brown, SKColors.DarkCyan, SKColors.Purple };
+
+ 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);
+
+ //贝塞尔线条
+ for (int i = 0; i < 2; i++)
+ {
+ var p1 = new SKPoint(0, random.Next(bitmap.Height));
+ var p2 = new SKPoint(random.Next(bitmap.Width), random.Next(bitmap.Height));
+ var p3 = new SKPoint(random.Next(bitmap.Width), random.Next(bitmap.Height));
+ var p4 = new SKPoint(bitmap.Width, random.Next(bitmap.Height));
+
+ var touchPoints = new SKPoint[] { p1, p2, p3, p4 };
+
+ using var bPen = new SKPaint();
+ bPen.Color = random.GetRandom(c);
+ 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);
+ }
+
+ //噪点
+ Enumerable.Range(0, 100).AsParallel().ForAll(_ =>
+ canvas.DrawPoint(random.Next(bitmap.Width), random.Next(bitmap.Height), SKColors.LightGray)
+ );
+
+ using var pen = new SKPaint();
+ pen.FakeBoldText = true;
+ pen.TextSize = 0.9f * info.Width * pen.TextSize / pen.MeasureText(code);
+ for (int i = 0; i < code.Length; i++)
+ {
+ pen.Color = random.GetRandom(c);//随机颜色索引值
+ pen.Typeface = SKTypeface.FromFamilyName(random.GetRandom(fonts), 700, 20, SKFontStyleSlant.Italic);//配置字体
+ var point = new SKPoint()
+ {
+ X = i * 12,
+ Y = info.Height - ((i + 1) % 2 == 0 ? 2 : 4)
+ };
+ //pen.MeasureText(code.Substring(i, 1), ref textBounds);
+ canvas.DrawText(code.Substring(i, 1), point, pen);//绘制一个验证字符
+ }
+ return bitmap.ToBase64String(SKEncodedImageFormat.Png);
+ }
+ public static T GetRandom(this Random random, T[] tArray)
+ {
+ if (random == null) random = new Random();
+ return tArray[random.Next(tArray.Length)];
+ }
+
+ public static string ToBase64String(this SKBitmap bitmap, SKEncodedImageFormat format)
+ {
+ using var memStream = new MemoryStream();
+ using var wstream = new SKManagedWStream(memStream);
+ bitmap.Encode(wstream, format, 32);
+ memStream.TryGetBuffer(out ArraySegment buffer);
+ return $"{Convert.ToBase64String(buffer.Array, 0, (int)memStream.Length)}";
+ }
+}
\ No newline at end of file
diff --git "a/.Net6\347\211\210\346\234\254/VOL.Core/Utilities/VierificationCodeServices.cs" "b/.Net6\347\211\210\346\234\254/VOL.Core/Utilities/VierificationCodeServices.cs"
index 2fe795543333adbe74a07d3b373c1461badc4200..a1b2b2b2494ae99a2f4d9da7a89acb5977e354aa 100644
--- "a/.Net6\347\211\210\346\234\254/VOL.Core/Utilities/VierificationCodeServices.cs"
+++ "b/.Net6\347\211\210\346\234\254/VOL.Core/Utilities/VierificationCodeServices.cs"
@@ -2,6 +2,7 @@
using System.DrawingCore;
using System.DrawingCore.Imaging;
using System.IO;
+using System.Runtime.Versioning;
namespace DotNet.Utilities
{
@@ -45,7 +46,8 @@ namespace DotNet.Utilities
/// 该方法是将生成的随机数写入图像文件
///
/// code是一个随机数
- /// 生成位数(默认4位)
+ /// 生成位数(默认4位)
+ [SupportedOSPlatform("Windows")]
public static MemoryStream Create(out string code, int numbers = 4)
{
code = RndNum(numbers);
diff --git "a/.Net6\347\211\210\346\234\254/VOL.Core/VOL.Core.csproj" "b/.Net6\347\211\210\346\234\254/VOL.Core/VOL.Core.csproj"
index a41f85e8421ef87b4d0a51ec7c978cd5b4085f70..18ba39301728c9be8fdf1fe4cfe3625ad245a688 100644
--- "a/.Net6\347\211\210\346\234\254/VOL.Core/VOL.Core.csproj"
+++ "b/.Net6\347\211\210\346\234\254/VOL.Core/VOL.Core.csproj"
@@ -35,26 +35,27 @@
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
+
+
diff --git "a/.Net6\347\211\210\346\234\254/VOL.Core/VOL.Core.csproj.user" "b/.Net6\347\211\210\346\234\254/VOL.Core/VOL.Core.csproj.user"
deleted file mode 100644
index 5b80dcc1ac7da87b05014b0e56a3ba37295be4a2..0000000000000000000000000000000000000000
--- "a/.Net6\347\211\210\346\234\254/VOL.Core/VOL.Core.csproj.user"
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
- false
- VOL.Core
-
-
- ProjectDebugger
-
-
\ No newline at end of file
diff --git "a/.Net6\347\211\210\346\234\254/VOL.Entity/VOL.Entity.csproj" "b/.Net6\347\211\210\346\234\254/VOL.Entity/VOL.Entity.csproj"
index 89ba8aa7c8ba948c2dfe46badc0e9f1684967980..eebbf82461f959f927b418dcb0d92f873c6fc9b4 100644
--- "a/.Net6\347\211\210\346\234\254/VOL.Entity/VOL.Entity.csproj"
+++ "b/.Net6\347\211\210\346\234\254/VOL.Entity/VOL.Entity.csproj"
@@ -21,10 +21,10 @@
-
-
-
-
+
+
+
+
diff --git "a/.Net6\347\211\210\346\234\254/VOL.System/Services/System/Partial/Sys_DictionaryService.cs" "b/.Net6\347\211\210\346\234\254/VOL.System/Services/System/Partial/Sys_DictionaryService.cs"
index 8eb6e3ccb8525a76f68b7041a97c1a02e226c2c9..9f5859c0b6a40bbc4ba32c4a95c43496763857fd 100644
--- "a/.Net6\347\211\210\346\234\254/VOL.System/Services/System/Partial/Sys_DictionaryService.cs"
+++ "b/.Net6\347\211\210\346\234\254/VOL.System/Services/System/Partial/Sys_DictionaryService.cs"
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@@ -33,7 +34,7 @@ namespace VOL.System.Services
public object GetVueDictionary(string[] dicNos)
{
- if (dicNos == null || dicNos.Count() == 0) return new string[] { };
+ if (dicNos == null || dicNos.Length == 0) return Array.Empty();
var dicConfig = DictionaryManager.GetDictionaries(dicNos, false).Select(s => new
{
dicNo = s.DicNo,
diff --git "a/.Net6\347\211\210\346\234\254/VOL.System/Services/System/Partial/Sys_RoleService.cs" "b/.Net6\347\211\210\346\234\254/VOL.System/Services/System/Partial/Sys_RoleService.cs"
index 0daa8e8779dbfa24dc518fdf9768c56a119d4389..0012058c3cae149564d59d1b77a32a409a0e260f 100644
--- "a/.Net6\347\211\210\346\234\254/VOL.System/Services/System/Partial/Sys_RoleService.cs"
+++ "b/.Net6\347\211\210\346\234\254/VOL.System/Services/System/Partial/Sys_RoleService.cs"
@@ -298,7 +298,7 @@ namespace VOL.System.Services
//标识缓存已更新
base.CacheContext.Add(roleId.GetRoleIdKey(), _version);
- _responseContent.OK($"保存成功:新增加配菜单权限{addCount}条,更新菜单{updateCount}条,删除权限{delAuths.Count()}条");
+ _responseContent.OK($"保存成功:新增加配菜单权限{addCount}条,更新菜单{updateCount}条,删除权限{delAuths.Count}条");
}
catch (Exception ex)
{
diff --git "a/.Net6\347\211\210\346\234\254/VOL.System/VOL.System.csproj" "b/.Net6\347\211\210\346\234\254/VOL.System/VOL.System.csproj"
index 04ba03a6551fea078c83c7c4bcb4441880ef45b3..f32edc7b85f2b2efc20cd1395afc8ec1d81f32d1 100644
--- "a/.Net6\347\211\210\346\234\254/VOL.System/VOL.System.csproj"
+++ "b/.Net6\347\211\210\346\234\254/VOL.System/VOL.System.csproj"
@@ -17,11 +17,11 @@
-
-
-
-
-
+
+
+
+
+
diff --git "a/.Net6\347\211\210\346\234\254/VOL.WebApi/Controllers/AppManager/Partial/App_NewsController.cs" "b/.Net6\347\211\210\346\234\254/VOL.WebApi/Controllers/AppManager/Partial/App_NewsController.cs"
index 299bd6ccd2bf1a9fce666020ec28165697edd211..e7e8c7946f9bc47983276594f7efd6110533955a 100644
--- "a/.Net6\347\211\210\346\234\254/VOL.WebApi/Controllers/AppManager/Partial/App_NewsController.cs"
+++ "b/.Net6\347\211\210\346\234\254/VOL.WebApi/Controllers/AppManager/Partial/App_NewsController.cs"
@@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
+using System;
using System.Linq;
using System.Threading.Tasks;
using VOL.AppManager.IRepositories;
@@ -76,7 +77,7 @@ namespace VOL.AppManager.Controllers
?.ToList();
if (data == null)
{
- return Json(new object[] { });
+ return Json(Array.Empty