Pārlūkot izejas kodu

更新dbconfig配置默认支持vue3
更新nuget包

zhontai 2 gadi atpakaļ
vecāks
revīzija
9b1461e6b1

+ 2 - 2
src/hosts/ZhonTai.Host/Configs/dbconfig.json

@@ -10,7 +10,7 @@
   //监听Curd操作
   "curd": true,
 
-  //建库
+  //建库,Sqlite数据库不用配置建库,连接语句自动建库
   "createDb": false,
   //SqlServer,PostgreSQL,Oracle,OdbcOracle,OdbcSqlServer,OdbcMySql,OdbcPostgreSQL,Odbc,OdbcDameng,MsAccess
   //建库连接字符串
@@ -29,7 +29,7 @@
   //同步数据
   "syncData": true,
   //同步数据地址
-  "SyncDataPath": "InitData/Admin/Vue2",
+  //"SyncDataPath": "InitData/Admin/Vue2",
 
   //项目初始化不开启生成数据,发布生产环境前,如果开发环境有配置数据需要更新数据包,可以开启生成数据包,使用完记得关闭
   //开启生成数据前先关闭syncStructure syncData createDb

+ 2 - 2
src/hosts/ZhonTai.Host/InitData/Admin/ad_permission.json

@@ -18,7 +18,7 @@
         "type": 2,
         "viewId": 161227168428101,
         "path": "/platform/workbench",
-        "icon": "ele-Menu",
+        "icon": "iconfont icon-shuju1",
         "opened": true,
         "isKeepAlive": true,
         "isAffix": true,
@@ -725,7 +725,7 @@
             "viewId": 161227168444485,
             "name": "admin/view",
             "path": "/platform/system/view",
-            "icon": "iconfont icon-zujian",
+            "icon": "fa fa-credit-card",
             "opened": true,
             "isKeepAlive": true,
             "sort": 5,

+ 4 - 6
src/platform/ZhonTai.Admin/Core/Helpers/UploadHelper.cs

@@ -27,7 +27,7 @@ public class UploadHelper
     /// <param name="args"></param>
     /// <param name="cancellationToken"></param>
     /// <returns></returns>
-    public async Task<FileInfo> UploadAsync(IFormFile file, FileUploadConfig config, object args, CancellationToken cancellationToken = default)
+    public static async Task<FileInfo> UploadAsync(IFormFile file, FileUploadConfig config, object args, CancellationToken cancellationToken = default)
     { 
         if (file == null || file.Length < 1)
         {
@@ -75,11 +75,9 @@ public class UploadHelper
     /// <param name="filePath"></param>
     /// <param name="cancellationToken"></param>
     /// <returns></returns>
-    public async Task SaveAsync(IFormFile file, string filePath, CancellationToken cancellationToken = default)
+    public static async Task SaveAsync(IFormFile file, string filePath, CancellationToken cancellationToken = default)
     {
-        using (var stream = File.Create(filePath))
-        {
-            await file.CopyToAsync(stream, cancellationToken);
-        }
+        using var stream = File.Create(filePath);
+        await file.CopyToAsync(stream, cancellationToken);
     }
 }

+ 1 - 1
src/platform/ZhonTai.Admin/Services/Document/DocumentService.cs

@@ -248,7 +248,7 @@ public class DocumentService : BaseService, IDocumentService, IDynamicApi
         var uploadHelper = LazyGetRequiredService<UploadHelper>();
 
         var config = uploadConfig.Document;
-        var fileInfo = await uploadHelper.UploadAsync(input.File, config, new { input.Id });
+        var fileInfo = await UploadHelper.UploadAsync(input.File, config, new { input.Id });
         //保存文档图片
         await AddImageAsync(new DocumentAddImageInput
         {

+ 1 - 1
src/platform/ZhonTai.Admin/Services/User/UserService.cs

@@ -697,7 +697,7 @@ public class UserService : BaseService, IUserService, IDynamicApi
         var uploadConfig = LazyGetRequiredService<IOptionsMonitor<UploadConfig>>().CurrentValue;
         var uploadHelper = LazyGetRequiredService<UploadHelper>();
         var config = uploadConfig.Avatar;
-        var fileInfo = await uploadHelper.UploadAsync(file, config, new { User.Id });
+        var fileInfo = await UploadHelper.UploadAsync(file, config, new { User.Id });
         return fileInfo.FileRelativePath;
     }
 }

+ 1 - 1
src/platform/ZhonTai.Admin/ZhonTai.Admin.csproj

@@ -23,7 +23,7 @@
 		<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
 		<PackageReference Include="Mapster" Version="7.3.0" />
 		<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="7.0.0" />
-		<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.0" />
+		<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.1" />
 		<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.2.22" />
 		<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.2.22" />
 		<PackageReference Include="NLog" Version="5.1.0" />

+ 2 - 2
src/tests/ZhonTai.Tests/ZhonTai.Tests.csproj

@@ -6,8 +6,8 @@
 	</PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.0" />
-    <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.0" />
+    <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.1" />
+    <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.1" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
     <PackageReference Include="xunit" Version="2.4.2" />
     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">