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()); } return Json(data); } diff --git "a/.Net6\347\211\210\346\234\254/VOL.WebApi/Controllers/Hubs/HomePageMessageHub.cs" "b/.Net6\347\211\210\346\234\254/VOL.WebApi/Controllers/Hubs/HomePageMessageHub.cs" index e53207d0199b90998e4a8baae2ed483b4a1033e7..173c5cda38e6198b343b8ace3f4bcfbe8d577ecc 100644 --- "a/.Net6\347\211\210\346\234\254/VOL.WebApi/Controllers/Hubs/HomePageMessageHub.cs" +++ "b/.Net6\347\211\210\346\234\254/VOL.WebApi/Controllers/Hubs/HomePageMessageHub.cs" @@ -14,8 +14,8 @@ using VOL.System.IServices; namespace VOL.WebApi.Controllers.Hubs { /// - /// https://docs.microsoft.com/zh-cn/aspnet/core/signalr/introduction?view=aspnetcore-3.1 - /// https://docs.microsoft.com/zh-cn/aspnet/core/signalr/javascript-client?view=aspnetcore-6.0&tabs=visual-studio + /// + /// /// public class HomePageMessageHub : Hub { @@ -52,7 +52,7 @@ namespace VOL.WebApi.Controllers.Hubs /// /// /// - public override async Task OnDisconnectedAsync(Exception ex) + public override async Task OnDisconnectedAsync(Exception? ex) { //Console.WriteLine($"断开连接{Context.ConnectionId}"); //从组中删除 diff --git "a/.Net6\347\211\210\346\234\254/VOL.WebApi/Controllers/System/Partial/Sys_UserController.cs" "b/.Net6\347\211\210\346\234\254/VOL.WebApi/Controllers/System/Partial/Sys_UserController.cs" index 2f4afd6c1e9096b5d121c540bb60b6b70bc8a8b3..835c468cd42a016a0a275869c02c51c5ba364557 100644 --- "a/.Net6\347\211\210\346\234\254/VOL.WebApi/Controllers/System/Partial/Sys_UserController.cs" +++ "b/.Net6\347\211\210\346\234\254/VOL.WebApi/Controllers/System/Partial/Sys_UserController.cs" @@ -1,27 +1,21 @@  -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Concurrent; using System.Linq; -using System.Linq.Expressions; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Caching.Memory; +using Microsoft.Extensions.DependencyInjection; using VOL.Core.CacheManager; using VOL.Core.Configuration; -using VOL.Core.Controllers.Basic; -using VOL.Core.DBManager; -using VOL.Core.EFDbContext; using VOL.Core.Enums; using VOL.Core.Extensions; using VOL.Core.Filters; -using VOL.Core.Infrastructure; using VOL.Core.ManageUser; using VOL.Core.ObjectActionValidator; using VOL.Core.Services; using VOL.Core.Utilities; -using VOL.Entity.AttributeManager; using VOL.Entity.DomainModels; using VOL.System.IRepositories; using VOL.System.IServices; @@ -169,7 +163,7 @@ namespace VOL.System.Controllers string code = VierificationCode.RandomText(); var data = new { - img = VierificationCode.CreateBase64Imgage(code), + img = VierificationCodeHelpers.CreateBase64Image(code), uuid = Guid.NewGuid() }; HttpContext.GetService().Set(data.uuid.ToString(), code, new TimeSpan(0, 5, 0)); diff --git "a/.Net6\347\211\210\346\234\254/VOL.WebApi/Dockerfile" "b/.Net6\347\211\210\346\234\254/VOL.WebApi/Dockerfile" new file mode 100644 index 0000000000000000000000000000000000000000..408f58137e3bcf25fb2509e0186dda910264ae5e --- /dev/null +++ "b/.Net6\347\211\210\346\234\254/VOL.WebApi/Dockerfile" @@ -0,0 +1,31 @@ +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. + + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +RUN apt-get update; apt-get install libfontconfig1 -y + +WORKDIR /app +EXPOSE 9991 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["VOL.WebApi/VOL.WebApi.csproj", "VOL.WebApi/"] +COPY ["VOL.System/VOL.System.csproj", "VOL.System/"] +COPY ["VOL.Core/VOL.Core.csproj", "VOL.Core/"] +COPY ["VOL.Entity/VOL.Entity.csproj", "VOL.Entity/"] +COPY ["VOL.Order/VOL.Order.csproj", "VOL.Order/"] +COPY ["VOL.AppManager/VOL.AppManager.csproj", "VOL.AppManager/"] +COPY ["VOL.Builder/VOL.Builder.csproj", "VOL.Builder/"] +RUN dotnet restore "VOL.WebApi/VOL.WebApi.csproj" + +COPY . . +WORKDIR "/src/VOL.WebApi" +RUN dotnet build "VOL.WebApi.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "VOL.WebApi.csproj" -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "VOL.WebApi.dll"] \ No newline at end of file diff --git "a/.Net6\347\211\210\346\234\254/VOL.WebApi/Properties/PublishProfiles/FolderProfile.pubxml.user" "b/.Net6\347\211\210\346\234\254/VOL.WebApi/Properties/PublishProfiles/FolderProfile.pubxml.user" deleted file mode 100644 index 348f8bd1461e6997cf3866544481d9d49ac1ca7f..0000000000000000000000000000000000000000 --- "a/.Net6\347\211\210\346\234\254/VOL.WebApi/Properties/PublishProfiles/FolderProfile.pubxml.user" +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - <_PublishTargetUrl>E:\jxx\Vue.NetCore\Vue.Net\VOL.WebApi\bin\Release\netcoreapp3.1\publish\ - True|2022-05-04T06:22:09.8601614Z;True|2022-05-04T14:17:58.5839043+08:00;True|2022-05-04T14:04:46.6624577+08:00;True|2022-05-04T14:01:00.7514191+08:00;True|2022-05-04T13:38:17.6611755+08:00;True|2022-05-04T12:49:24.8764268+08:00;True|2022-05-04T12:46:59.8927233+08:00;False|2022-05-04T12:46:29.9426973+08:00;True|2022-05-04T12:45:13.9857344+08:00;True|2022-05-04T12:43:20.8195741+08:00;True|2022-05-04T12:37:57.5020415+08:00; - - \ No newline at end of file diff --git "a/.Net6\347\211\210\346\234\254/VOL.WebApi/Properties/launchSettings.json" "b/.Net6\347\211\210\346\234\254/VOL.WebApi/Properties/launchSettings.json" index f47b4f7c93bdeff07be5af7a7f18f83593a4dde3..b2cce7a740408ec12c50553efbfc75b38cfe2586 100644 --- "a/.Net6\347\211\210\346\234\254/VOL.WebApi/Properties/launchSettings.json" +++ "b/.Net6\347\211\210\346\234\254/VOL.WebApi/Properties/launchSettings.json" @@ -1,12 +1,4 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:1309", - "sslPort": 44318 - } - }, +{ "profiles": { "IIS Express": { "commandName": "IISExpress", @@ -18,10 +10,27 @@ "VOL.WebApi": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "https://localhost:5001;http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "http://localhost:9991;" + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "httpPort": 9991, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "publishAllPorts": true, + "useSSL": false, + "sslPort": 44360 + } + }, + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:9991", + "sslPort": 44318 } } -} +} \ No newline at end of file diff --git "a/.Net6\347\211\210\346\234\254/VOL.WebApi/VOL.WebApi.csproj" "b/.Net6\347\211\210\346\234\254/VOL.WebApi/VOL.WebApi.csproj" index 0b7b2574dd57ad7b928384ad4f2f8c5394b1341b..1821f980c0b4603c683da272916116484b0fd582 100644 --- "a/.Net6\347\211\210\346\234\254/VOL.WebApi/VOL.WebApi.csproj" +++ "b/.Net6\347\211\210\346\234\254/VOL.WebApi/VOL.WebApi.csproj" @@ -3,6 +3,8 @@ net6.0 enable + 51c29fac-5aae-45d7-912d-bb25567fcc4b + Linux @@ -18,9 +20,10 @@ - - - + + + + diff --git "a/.Net6\347\211\210\346\234\254/VOL.WebApi/VOL.WebApi.csproj.user" "b/.Net6\347\211\210\346\234\254/VOL.WebApi/VOL.WebApi.csproj.user" deleted file mode 100644 index 40ea130f2e191f99ed41a0a83fa33eabea47b21e..0000000000000000000000000000000000000000 --- "a/.Net6\347\211\210\346\234\254/VOL.WebApi/VOL.WebApi.csproj.user" +++ /dev/null @@ -1,15 +0,0 @@ - - - - ProjectDebugger - - - VOL.WebApi - E:\jxx\Vue.NetCore\Vue.Net\VOL.WebApi\Properties\PublishProfiles\FolderProfile.pubxml - MvcControllerEmptyScaffolder - root/Common/MVC/Controller - - - ProjectDebugger - - \ No newline at end of file diff --git "a/.Net6\347\211\210\346\234\254/VOL.v12.suo" "b/.Net6\347\211\210\346\234\254/VOL.v12.suo" deleted file mode 100644 index 3797c9f4d18c8bb622aea74ca71c6880e5c9cad9..0000000000000000000000000000000000000000 Binary files "a/.Net6\347\211\210\346\234\254/VOL.v12.suo" and /dev/null differ diff --git a/.gitignore b/.gitignore index f92c5e0b5d64abf03965aa013581872aa2903cdc..ff2d221ae9bbb6c3fc8ce2a172e9ab49615c268c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,58 +1,13 @@ -/Vol.Vue/node_modules -/Vue.Net/VOL.Web/bin -/Vue.Net/VOL.WebApi/bin -/Vue.Net/VOL.WebApi/Download/ExcelExport -/Vue.Net/VOL.WebApi/Download/Logger -/Vue.Net/VOL.WebApi/Download/SqlLog -/Vue.Net/VOL.WebApi/obj -/Vue.Net/.vs -/Vue.Net/VOL.Entity/bin -/Vue.Net/VOL.Entity/obj -/Vue.Net/VOL.AppManager/bin -/Vue.Net/VOL.AppManager/obj -/Vue.Net/VOL.Builder/obj -/Vue.Net/VOL.Builder/bin -/Vue.Net/VOL.Core/obj -/Vue.Net/VOL.Core/bin -/Vue.Net/VOL.Order/obj -/Vue.Net/VOL.Order/bin -/Vue.Net/VOL.System/obj -/Vue.Net/VOL.System/bin -/Vue.Net/VOL.Web/obj -/Vue.Net/VOL.WebApi/Download/* -/Vol.Vue/dist -/Vue.Net/VOL.WebApi/wwwroot/Upload/ -/Vue.Net/VOL.Web -/开发版dev/Vue.NetCore/Vol.Vue/node_modules -/开发版dev/Vue.NetCore/Vue.Net/VOL.System/bin -/开发版dev/Vue.NetCore/Vue.Net/VOL.WebApi/bin -/开发版dev/Vue.NetCore/Vue.Net/VOL.Entity/bin -/开发版dev/Vue.NetCore/Vue.Net/VOL.Builder/bin -/开发版dev/Vue.NetCore/Vue.Net/VOL.Core/obj -/开发版dev/Vue.NetCore/Vue.Net/VOL.Builder/obj -/开发版dev/Vue.NetCore/Vue.Net/VOL.Entity/obj -/开发版dev/Vue.NetCore/Vue.Net/VOL.System/obj -/开发版dev/Vue.NetCore/Vue.Net/VOL.WebApi/obj -/开发版dev/Vue.NetCore/Vue.Net/VOL.Core/bin -/_ReSharper.Caches/* -/.vs/* -/开发版dev/Vue.NetCore/Vue.Net/_ReSharper.Caches/* -/开发版dev/Vue.NetCore/Vue.Net/.vs/* -/Vue.Net/_ReSharper.Caches/ReSharperPlatformVs16192_607b9a31.VOL.00 -/开发版dev/Vue.NetCore/Vue.Net/VOL.WebApi/Download/Logger/Queue/WriteError -/开发版dev/Vue.NetCore/Vue.Net/.vs -/.Net6版本/.vs -/.Net6版本/VOL.AppManager/obj -/.Net6版本/VOL.AppManager/bin -/.Net6版本/VOL.Builder/obj -/.Net6版本/VOL.Builder/bin -/.Net6版本/VOL.Core/obj -/.Net6版本/VOL.Core/bin -/.Net6版本/VOL.Entity/obj -/.Net6版本/VOL.Entity/bin -/.Net6版本/VOL.Order/obj -/.Net6版本/VOL.Order/bin -/.Net6版本/VOL.System/obj -/.Net6版本/VOL.System/bin -/.Net6版本/VOL.WebApi/obj -/.Net6版本/VOL.WebApi/bin +dist +Upload +node_modules +Download +_ReSharper.Caches +.vs +obj +bin +*.user +/.Net6版本/*.suo +/.Net6版本/VOL.WebApi/Properties/PublishProfiles/*.user +/.Net6版本/VOL.WebApi/*.user +/.Net6版本/VOL.Core/*.user diff --git a/README.md b/README.md index a3adbd6d35dbedea94b4e7cd7acbaa836a6997c6..487fefdc73e5c84867206df6a599a8e0fac0aeae 100644 --- a/README.md +++ b/README.md @@ -33,73 +33,73 @@ ## App/H5开发 - http://v2.volcore.xyz/app/guide ## 框架移动端(uniapp)已发布,同样全自动生成代码 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/qrcode.png) -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/m001.png) -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/m002.png) +![Home](/imgs/qrcode.png) +![Home](/imgs/m001.png) +![Home](/imgs/m002.png) ## 框架已支持Vue3版本 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/v3.png) +![Home](/imgs/v3.png) ## 框架已增加低代码设计器 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/fd01.png) -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/fd02.png) +![Home](/imgs/fd01.png) +![Home](/imgs/fd02.png) ## 框架2.0已更新(部分新增功能截图) 增加切换皮肤功能 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/h.png) -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/home_them.png) +![Home](/imgs/h.png) +![Home](/imgs/home_them.png) 增加可复用的后台请求参数校验 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/validator.png) +![Home](/imgs/validator.png) 增加树形菜单与代码生成页面使用 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/x7tree.png) +![Home](/imgs/x7tree.png) 增加文本编辑器直接发布静态页面功能 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/editor.png) +![Home](/imgs/editor.png) 一对一多从表显示(只需要少量代码就可完成成,其他都由代码生成器生成) -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/m1.png) +![Home](/imgs/m1.png) 表合并显示 (只需要几行代码完成代码生成器生成的页面实现扩展) -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/span.png) +![Home](/imgs/span.png) 从图上传图片 (只需要几行代码完成代码生成器生成的页面实现扩展) -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/p1.png) +![Home](/imgs/p1.png) 一对多从表(不限从表数量)扩展 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/multi.png) +![Home](/imgs/multi.png) 图表 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/charts.png) +![Home](/imgs/charts.png) ## 1、只读基础表单 整个只读的基础表单的所有前后端代码,全部由代码生成器生成,代码生成器中几乎不需要配置,并支持并后端业务代码扩展,直接生成代码后,配置菜单权限即可 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/table1.png) +![Home](/imgs/table1.png) ## 2、自动绑定下拉框数据表单 整个自动绑定下拉框数据表单的所有前后端代码,全部由代码生成器生成,并支持并后端业务代码扩展,在代码生成器中只需要指定数据源编号,页面加载时会根据编号自动加载数据源并绑定 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/table2.png) +![Home](/imgs/table2.png) ## 3、启用图片支持、审核表单 整个启用图片支持、审核表单的所有前后端代码,全部由代码生成器生成,并支持并后端业务代码扩展,审核功能需要在菜单配置权限、代码生成器中勾选启用图片支持 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/table3.png) +![Home](/imgs/table3.png) ## 4、高级查询 整个表单的所有前后端代码,全部由代码生成器生成,并支持并后端业务代码扩展,查询字段、类型(下拉框、日期、TextArea等)、所在行与列都由代码生成器完成,不需要写任何代码 - ![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/tablesearch4.png) + ![Home](/imgs/tablesearch4.png) ## 5、主从表新建、编辑 主从表新建、编辑所有前后端代码,全部由代码生成器生成,并支持并后端业务代码扩展,新建、编辑从表配置、字段、类型(下拉框、日期、TextArea等)、所在行与列、字段是否只读、标签显示的长度等都由代码生成器完成,不需要写任何代码 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/editTbale2.png) +![Home](/imgs/editTbale2.png) ## 6、excel导入 excel导入整个页面都由代码生成器生成,导入的字段、字段是否必填,下载模板也由代码生成器上配置(自己根据实际需要决定是否采用此方法),导入时会验证是否为空与数据的合法性,逻辑校验自己实现扩展方法即可 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/importTable1.png) +![Home](/imgs/importTable1.png) ## 7、H5开发 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/h5.jpg) +![Home](/imgs/h5.jpg) ## 8、权限分配 目前只实现了对用户的角色的Action进行权限分配 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/auth.png) +![Home](/imgs/auth.png) ## 9、代码生成器 代码生成器提供了20多种可配置的属性,可灵活配置显示、查询、编辑、导入、导出、主从关系等功能点击看代码生成器文档 -![Home](https://github.com/cq-panda/Vue.NetCore/blob/master/imgs/coder.png) +![Home](/imgs/coder.png) 其他功能。。。。。 diff --git "a/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Builder/Services/Core/Partial/Sys_TableInfoService.cs" "b/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Builder/Services/Core/Partial/Sys_TableInfoService.cs" index b84eaf414bd952539cb069798981c8f868c3186f..60383133b335dd60ae868004f608627a0e7b2337 100644 --- "a/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Builder/Services/Core/Partial/Sys_TableInfoService.cs" +++ "b/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Builder/Services/Core/Partial/Sys_TableInfoService.cs" @@ -1261,7 +1261,7 @@ DISTINCT tableId = repository.Find(x => x.TableName == tableName, s => s.Table_Id).FirstOrDefault(); if (tableId > 0) return tableId; - bool isMySql = DBType.Name == DbCurrentType.MySql.ToString(); + bool isMySql = DBType.Name.Equals(nameof(DbCurrentType.MySql),StringComparison.OrdinalIgnoreCase); Sys_TableInfo tableInfo = new Sys_TableInfo() { ParentId = parentId, @@ -1738,7 +1738,7 @@ DISTINCT { string tableTrueName = tableInfo.TableTrueName; //2020.06.14 pgsql数据库,设置表名为小写(数据库创建表的时候也要使用小写) - if (DBType.Name == DbCurrentType.PgSql.ToString()) + if (DBType.Name.Equals(nameof(DbCurrentType.PgSql),StringComparison.OrdinalIgnoreCase)) { tableTrueName = tableTrueName.ToLower(); } diff --git "a/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/BaseProvider/ServiceBase.cs" "b/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/BaseProvider/ServiceBase.cs" index 453ad5702a149e11d27bf3280cd79c7bb0e5706b..282c9198d2592c023625d8ca0080c16dbb482dc4 100644 --- "a/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/BaseProvider/ServiceBase.cs" +++ "b/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/BaseProvider/ServiceBase.cs" @@ -1066,7 +1066,7 @@ namespace VOL.Core.BaseProvider string sql = $"DELETE FROM {entityType.GetEntityTableName() } where {tKey} in ({joinKeys});"; // 2020.08.06增加pgsql删除功能 - if (DBType.Name == DbCurrentType.PgSql.ToString()) + if (DBType.Name.Equals(nameof(DbCurrentType.PgSql),StringComparison.OrdinalIgnoreCase)) { sql = $"DELETE FROM \"public\".\"{entityType.GetEntityTableName() }\" where \"{tKey}\" in ({joinKeys});"; } @@ -1075,7 +1075,7 @@ namespace VOL.Core.BaseProvider Type detailType = GetRealDetailType(); if (detailType != null) { - if (DBType.Name == DbCurrentType.PgSql.ToString()) + if (DBType.Name.Equals(nameof(DbCurrentType.PgSql),StringComparison.OrdinalIgnoreCase)) { sql += $"DELETE FROM \"public\".\"{detailType.GetEntityTableName()}\" where \"{tKey}\" in ({joinKeys});"; } diff --git "a/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/DBManager/DBServerProvider.cs" "b/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/DBManager/DBServerProvider.cs" index 30bfac727661ca6ecfbabff75f0e8251fd8cd701..09ced80ef229154738eb9bff3351a621fb8ce996 100644 --- "a/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/DBManager/DBServerProvider.cs" +++ "b/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/DBManager/DBServerProvider.cs" @@ -64,11 +64,11 @@ namespace VOL.Core.DBManager { connString = ConnectionPool[DefaultConnName]; } - if (DBType.Name == DbCurrentType.MySql.ToString()) + if (DBType.Name.Equals(nameof(DbCurrentType.MySql),StringComparison.OrdinalIgnoreCase)) { return new MySql.Data.MySqlClient.MySqlConnection(connString); } - if (DBType.Name == DbCurrentType.PgSql.ToString()) + if (DBType.Name.Equals(nameof(DbCurrentType.PgSql),StringComparison.OrdinalIgnoreCase)) { return new NpgsqlConnection(connString); } diff --git "a/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/Dapper/SqlDapper.cs" "b/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/Dapper/SqlDapper.cs" index 1de67cae15f0920500dbe792ed2e53a4186aaedb..fbe7eacf0c7c70dd3912d5dc539a0e224f3f666b 100644 --- "a/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/Dapper/SqlDapper.cs" +++ "b/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/Dapper/SqlDapper.cs" @@ -580,13 +580,13 @@ namespace VOL.Core.Dapper columns = properties.Select(x => x.Name).ToArray(); } string sql = null; - if (DBType.Name == DbCurrentType.MySql.ToString()) + if (DBType.Name.Equals(nameof(DbCurrentType.MySql),StringComparison.OrdinalIgnoreCase)) { //mysql批量写入待优化 sql = $"insert into {entityType.GetEntityTableName()}({string.Join(",", columns)})" + $"values(@{string.Join(",@", columns)});"; } - else if (DBType.Name == DbCurrentType.PgSql.ToString()) + else if (DBType.Name.Equals(nameof(DbCurrentType.PgSql),StringComparison.OrdinalIgnoreCase)) { //todo pgsql批量写入 待检查是否正确 sql = $"insert into {entityType.GetEntityTableName()}({"\"" + string.Join("\",\"", columns) + "\""})" + @@ -603,7 +603,7 @@ namespace VOL.Core.Dapper return Execute((conn, dbTransaction) => { //todo pgsql待实现 - return conn.Execute(sql, (DBType.Name == DbCurrentType.MySql.ToString() || DBType.Name == DbCurrentType.PgSql.ToString()) ? entities.ToList() : null, dbTransaction); + return conn.Execute(sql, (DBType.Name.Equals(nameof(DbCurrentType.MySql),StringComparison.OrdinalIgnoreCase) || DBType.Name.Equals(nameof(DbCurrentType.PgSql),StringComparison.OrdinalIgnoreCase)) ? entities.ToList() : null, dbTransaction); }, beginTransaction); } @@ -645,7 +645,7 @@ namespace VOL.Core.Dapper properties = properties.Where(x => updateFileds.GetExpressionToArray().Contains(x.Name)); } - if (DBType.Name == DbCurrentType.MySql.ToString()) + if (DBType.Name.Equals(nameof(DbCurrentType.MySql),StringComparison.OrdinalIgnoreCase)) { List paramsList = new List(); foreach (var item in properties) @@ -681,7 +681,7 @@ namespace VOL.Core.Dapper : $"'{string.Join("','", keys)}'"; string sql; // 2020.08.06增加pgsql删除功能 - if (DBType.Name == DbCurrentType.PgSql.ToString()) + if (DBType.Name.Equals(nameof(DbCurrentType.PgSql),StringComparison.OrdinalIgnoreCase)) { sql = $"DELETE FROM \"public\".\"{entityType.GetEntityTableName()}\" where \"{tKey}\" in ({joinKeys});"; } diff --git "a/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/Extensions/AutofacManager/AutofacContainerModuleExtension.cs" "b/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/Extensions/AutofacManager/AutofacContainerModuleExtension.cs" index 7aeb20fe14a9289717b4e47f7ff20fd60ee52997..05e24d5fc5607fce213b356d33408499a986367d 100644 --- "a/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/Extensions/AutofacManager/AutofacContainerModuleExtension.cs" +++ "b/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/Extensions/AutofacManager/AutofacContainerModuleExtension.cs" @@ -64,7 +64,7 @@ namespace VOL.Core.Extensions builder.RegisterType().InstancePerLifetimeScope(); string connectionString = DBServerProvider.GetConnectionString(null); - if (DBType.Name == DbCurrentType.MySql.ToString()) + if (DBType.Name.Equals(nameof(DbCurrentType.MySql),StringComparison.OrdinalIgnoreCase)) { //2020.03.31增加dapper对mysql字段Guid映射 SqlMapper.AddTypeHandler(new DapperParseGuidTypeHandler()); @@ -74,7 +74,7 @@ namespace VOL.Core.Extensions //mysql8.x的版本使用Pomelo.EntityFrameworkCore.MySql 3.1会产生异常,需要在字符串连接上添加allowPublicKeyRetrieval=true services.AddDbContextPool(optionsBuilder => { optionsBuilder.UseMySql(connectionString); }, 64); } - else if (DBType.Name == DbCurrentType.PgSql.ToString()) + else if (DBType.Name.Equals(nameof(DbCurrentType.PgSql),StringComparison.OrdinalIgnoreCase)) { services.AddDbContextPool(optionsBuilder => { optionsBuilder.UseNpgsql(connectionString); }, 64); } diff --git "a/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/Infrastructure/DictionaryHandler.cs" "b/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/Infrastructure/DictionaryHandler.cs" index 5be1013b45201e7f4c3435806c747da9a2545cc5..df9ee4fcad922cc7058fe3420b743342b5981b5b 100644 --- "a/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/Infrastructure/DictionaryHandler.cs" +++ "b/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.Core/Infrastructure/DictionaryHandler.cs" @@ -45,7 +45,7 @@ namespace VOL.Core.Infrastructure /// public static string GetRolesSql() { - if (DBType.Name == DbCurrentType.PgSql.ToString()) + if (DBType.Name.Equals(nameof(DbCurrentType.PgSql),StringComparison.OrdinalIgnoreCase)) { return "SELECT \"Role_Id\" as key,\"RoleName\" as value from Sys_Role"; } diff --git "a/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.System/Services/System/Partial/Sys_DictionaryService.cs" "b/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.System/Services/System/Partial/Sys_DictionaryService.cs" index 8eb6e3ccb8525a76f68b7041a97c1a02e226c2c9..efbcff17c36602f3f50487e57f34519a42772dd3 100644 --- "a/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/VOL.System/Services/System/Partial/Sys_DictionaryService.cs" +++ "b/\345\274\200\345\217\221\347\211\210dev/Vue.NetCore/Vue.Net/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; @@ -116,7 +117,7 @@ namespace VOL.System.Services public object GetTableDictionary(Dictionary keyData) { // 2020.08.06增加pgsql获取数据源 - if (DBType.Name == DbCurrentType.PgSql.ToString()) + if (DBType.Name.Equals(nameof(DbCurrentType.PgSql),StringComparison.OrdinalIgnoreCase)) { return GetPgSqlTableDictionary(keyData); } @@ -124,7 +125,7 @@ namespace VOL.System.Services .Select(x => new { x.DicNo, x.DbSql }) .ToList(); List list = new List(); - string keySql = DBType.Name == DbCurrentType.MySql.ToString() ? "t.key" : "t.[key]"; + string keySql = DBType.Name.Equals(nameof(DbCurrentType.MySql),StringComparison.OrdinalIgnoreCase) ? "t.key" : "t.[key]"; dicInfo.ForEach(x => { if (keyData.TryGetValue(x.DicNo, out object[] data))