mirror of
				https://gitee.com/ThingsGateway/ThingsGateway.git
				synced 2025-10-31 15:43:59 +08:00 
			
		
		
		
	sqlsugar偶发线程故障,添加copyNew方法
This commit is contained in:
		| @@ -105,7 +105,7 @@ namespace ThingsGateway.Application | ||||
|             if (desc == null) | ||||
|             { | ||||
|                 var taskT = method.Invoke(Target, args) as Task<T>; | ||||
|                 var result = await taskT;//如果没有缓存就执行方法返回数据 | ||||
|                 var result = await taskT; | ||||
|                 return result;//返回结果 | ||||
|             } | ||||
|             else | ||||
| @@ -116,7 +116,7 @@ namespace ThingsGateway.Application | ||||
|                 try | ||||
|                 { | ||||
|                     var taskT = method.Invoke(Target, args) as Task<T>; | ||||
|                     result = await taskT;//如果没有缓存就执行方法返回数据 | ||||
|                     result = await taskT; | ||||
|                 } | ||||
|                 catch (Exception ex) | ||||
|                 { | ||||
|   | ||||
| @@ -148,7 +148,7 @@ namespace ThingsGateway.Application.Services.Auth | ||||
|             }); | ||||
|  | ||||
|             //登录事件参数 | ||||
|             var logingEvent = new LoginEvent | ||||
|             var loginEvent = new LoginEvent | ||||
|             { | ||||
|                 Ip = App.HttpContext.GetRemoteIpAddressToIPv4(), | ||||
|                 Device = device, | ||||
| @@ -157,9 +157,9 @@ namespace ThingsGateway.Application.Services.Auth | ||||
|                 VerificatId = sessionid, | ||||
|             }; | ||||
|  | ||||
|             await WriteVerificatToCache(logingEvent);//写入verificat到cache | ||||
|             await WriteVerificatToCache(loginEvent);//写入verificat到cache | ||||
|  | ||||
|             await _eventPublisher.PublishAsync(EventSubscriberConst.Login, logingEvent); //发布登录事件总线 | ||||
|             await _eventPublisher.PublishAsync(EventSubscriberConst.Login, loginEvent); //发布登录事件总线 | ||||
|             return new LoginOutPut { VerificatId = sessionid, Account = sysUser.Account }; | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -89,7 +89,7 @@ namespace ThingsGateway.Application | ||||
|             if (sysResources == null) | ||||
|             { | ||||
|                 //cache没有就去数据库拿 | ||||
|                 sysResources = await base.GetListAsync(it => it.Category == category); | ||||
|                 sysResources = await CopyNew().GetListAsync(it => it.Category == category); | ||||
|                 if (sysResources.Count > 0) | ||||
|                 { | ||||
|                     //插入Cache | ||||
|   | ||||
| @@ -12,7 +12,7 @@ | ||||
|  | ||||
| @page "/login" | ||||
| @layout BaseLayout | ||||
| @inherits CultureLayoutComponentBase | ||||
| @inherits CultureComponentBase | ||||
| @namespace ThingsGateway.Web.Rcl | ||||
| @using BlazorComponent; | ||||
| @using Masa.Blazor.Presets; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 2248356998 qq.com
					2248356998 qq.com