浏览代码

😁1、定时任务仓储都加copynew 2、其他优化

zuohuaijun 2 年之前
父节点
当前提交
0b808ce1d3

+ 0 - 12
Admin.NET/Admin.NET.Application/Configuration/Swagger.json

@@ -16,18 +16,6 @@
           "Url": "https://gitee.com/zuohuaijun/Admin.NET"
         }
       },
-      {
-        "Group": "Application",
-        "Title": "Admin.NET 业务应用",
-        "Description": "Admin.NET Application<br/><a href='https://gitee.com/zuohuaijun/Admin.NET/'>https://gitee.com/zuohuaijun/Admin.NET</a>",
-        "Version": "1.0.0",
-        "TermsOfService": "https://dotnetchina.gitee.io/furion/",
-        "Contact": {
-          "Name": "zuohuaijun",
-          "Email": "515096995@qq.com",
-          "Url": "https://gitee.com/zuohuaijun/Admin.NET"
-        }
-      },
       {
         "Group": "All Groups",
         "Title": "所有接口",

+ 1 - 1
Admin.NET/Admin.NET.Application/Const/ApplicationConst.cs

@@ -17,5 +17,5 @@ public class ApplicationConst
     /// <summary>
     /// API分组名称
     /// </summary>
-    public const string GroupName = "Application";
+    public const string GroupName = "业务应用";
 }

+ 3 - 3
Admin.NET/Admin.NET.Core/Job/LogJob.cs

@@ -32,8 +32,8 @@ public class LogJob : IJob
         var logDiffRep = serviceScope.ServiceProvider.GetService<SqlSugarRepository<SysLogDiff>>();
 
         var daysAgo = 30; // 删除30天以前
-        await logVisRep.AsDeleteable().Where(u => (DateTime)u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除访问日志
-        await logOpRep.AsDeleteable().Where(u => (DateTime)u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除操作日志
-        await logDiffRep.AsDeleteable().Where(u => (DateTime)u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除差异日志
+        await logVisRep.CopyNew().AsDeleteable().Where(u => (DateTime)u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除访问日志
+        await logOpRep.CopyNew().AsDeleteable().Where(u => (DateTime)u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除操作日志
+        await logDiffRep.CopyNew().AsDeleteable().Where(u => (DateTime)u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除差异日志
     }
 }

+ 1 - 1
Admin.NET/Admin.NET.Core/Job/OnlineUserJob.cs

@@ -28,7 +28,7 @@ public class OnlineUserJob : IJob
         using var serviceScope = _scopeFactory.CreateScope();
 
         var rep = serviceScope.ServiceProvider.GetService<SqlSugarRepository<SysOnlineUser>>();
-        await rep.AsDeleteable().ExecuteCommandAsync(stoppingToken);
+        await rep.CopyNew().AsDeleteable().ExecuteCommandAsync(stoppingToken);
 
         var originColor = Console.ForegroundColor;
         Console.ForegroundColor = ConsoleColor.Red;

+ 1 - 1
Admin.NET/Admin.NET.Core/Service/Job/DbJobPersistence.cs

@@ -192,7 +192,7 @@ public class DbJobPersistence : IJobPersistence
             var jobTriggerRecordRep = scope.ServiceProvider.GetRequiredService<SqlSugarRepository<SysJobTriggerRecord>>();
 
             var jobTriggerRecord = timeline.Adapt<SysJobTriggerRecord>();
-            jobTriggerRecordRep.AsInsertable(jobTriggerRecord).ExecuteCommand();
+            jobTriggerRecordRep.CopyNew().AsInsertable(jobTriggerRecord).ExecuteCommand();
         }
     }
 }

+ 2 - 2
Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs

@@ -345,8 +345,8 @@ public class SysTenantService : IDynamicApiController, ITransient
     [NonAction]
     public async Task CacheTenant(long tenantId = 0)
     {
-        // 移除 ISqlSugarClient 中的库连接
-        if (tenantId > 0)
+        // 移除 ISqlSugarClient 中的库连接并排除默认主库
+        if (tenantId > 0 && tenantId.ToString() != SqlSugarConst.MainConfigId)
             _sysTenantRep.AsTenant().RemoveConnection(tenantId);
 
         var tenantList = await _sysTenantRep.GetListAsync();

+ 6 - 5
Web/package.json

@@ -1,8 +1,8 @@
 {
-	"name": "vue-next-admin",
+	"name": "admin.net",
 	"version": "2.4.33",
-	"description": "vue3 vite next admin template",
-	"author": "lyt_20201208",
+	"description": "Admin.NET 有可能是.NET最好用的通用权限开发框架",
+	"author": "zuohuaijun",
 	"license": "MIT",
 	"scripts": {
 		"dev": "vite",
@@ -84,13 +84,14 @@
 		"not dead"
 	],
 	"bugs": {
-		"url": "https://gitee.com/lyt-top/vue-next-admin/issues"
+		"url": "https://gitee.com/zuohuaijun/Admin.NET/issues"
 	},
 	"engines": {
 		"node": ">=16.0.0",
 		"npm": ">= 7.0.0"
 	},
 	"keywords": [
+		"admin.net",
 		"vue",
 		"vue3",
 		"vuejs/vue-next",
@@ -101,6 +102,6 @@
 	],
 	"repository": {
 		"type": "git",
-		"url": "https://gitee.com/lyt-top/vue-next-admin.git"
+		"url": "https://gitee.com/zuohuaijun/Admin.NET"
 	}
 }