Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9a1aa20

Browse files
committed
update context ,delete Icache in MenuService
1 parent0498b33 commit9a1aa20

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

‎src/Destiny.Core.Flow.API/Startups/MvcModule.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class MvcModule: MvcModuleBase
2020
{
2121
protectedoverridevoidPreConfigureServices(ConfigureServicesContextcontext)
2222
{
23-
context.Services.AddScoped<IAuthorityVerification,AuthorityVerificationServices>();
23+
//context.Services.AddScoped<IAuthorityVerification, AuthorityVerificationServices>();
2424
}
2525

2626
privatestring_corePolicyName=string.Empty;

‎src/Destiny.Core.Flow.EntityFrameworkCore/EntityFrameworkCoreModule.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected override IServiceCollection AddDbContextWithUnitOfWork(IServiceCollect
3131
//{
3232
// connection = provider.GetFileText(connection, $"未找到存放MySql数据库链接的文件");
3333
//}
34-
services.AddDestinyDbContext<DefaultDbContext>(x=>
34+
services.AddDestinyDbContext<DestinyCoreDbContext>(x=>
3535
{
3636
x.ConnectionString=connection;//settings.DbContexts.Values.First().ConnectionString;
3737
x.DatabaseType=settings.DbContexts.Values.First().DatabaseType;

‎src/Destiny.Core.Flow.Services/Menu/MenuServices.cs‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ public class MenuServices : IMenuServices
3939
privatereadonlyUserManager<User>_userManager;
4040
privatereadonlyRoleManager<Role>_roleManager;
4141
privatereadonlyMicrosoft.Extensions.Logging.ILogger_logger=null;
42-
privatereadonlyICache_cache=null;
42+
//private readonly ICache _cache = null;
4343

4444
privatereadonlyAsyncLock_mutex=newAsyncLock();
45-
publicMenuServices(IMenuRepositorymenuRepository,IUnitOfWorkunitOfWork,IRepository<RoleMenuEntity,Guid>roleMenuRepository,IMenuFunctionRepositorymenuFunction,IPrincipalprincipal,UserManager<User>userManager,RoleManager<Role>roleManager,IRepository<UserRole,Guid>repositoryUserRole,Microsoft.Extensions.Logging.ILoggerFactoryloggerFactory,ICachecache)
45+
publicMenuServices(IMenuRepositorymenuRepository,IUnitOfWorkunitOfWork,IRepository<RoleMenuEntity,Guid>roleMenuRepository,IMenuFunctionRepositorymenuFunction,IPrincipalprincipal,UserManager<User>userManager,RoleManager<Role>roleManager,IRepository<UserRole,Guid>repositoryUserRole,Microsoft.Extensions.Logging.ILoggerFactoryloggerFactory/*, ICache cache*/)
4646
{
4747
_menuRepository=menuRepository;
4848
_roleMenuRepository=roleMenuRepository;
@@ -53,7 +53,7 @@ public MenuServices(IMenuRepository menuRepository, IUnitOfWork unitOfWork, IRep
5353
_roleManager=roleManager;
5454
_repositoryUserRole=repositoryUserRole;
5555
_logger=loggerFactory.CreateLogger<MenuServices>();
56-
_cache=cache;
56+
//_cache = cache;
5757
}
5858

5959
publicasyncTask<OperationResponse>CreateAsync(MenuInputDtoinput)
@@ -287,9 +287,9 @@ public async Task<OperationResponse> GetVueDynamicRouterTreeAsync()
287287

288288
varkey=$"{routerKey}{userId}";
289289

290-
vartreeList=await_cache.GetAsync<IReadOnlyList<VueDynamicRouterTreeOutDto>>(key);//得到缓存
291-
if(treeList==null)
292-
{
290+
//var treeList = await _cache.GetAsync<IReadOnlyList<VueDynamicRouterTreeOutDto>>(key); //得到缓存
291+
//if (treeList == null)
292+
//{
293293

294294
intisAdmin=_iIdentity.FindFirst<int>(DestinyCoreFlowClaimTypes.IsAdmin);
295295
varroleids=_repositoryUserRole.Entities.Where(x=>x.UserId==userId).Select(x=>x.RoleId);
@@ -324,14 +324,14 @@ public async Task<OperationResponse> GetVueDynamicRouterTreeAsync()
324324

325325
TimeSpants2=sw.Elapsed;
326326
_logger.LogInformation($"得到动态路由所有多少{ts2.TotalMilliseconds}毫秒");
327-
await_cache.SetAsync(key,result.ItemList);
327+
//await _cache.SetAsync(key, result.ItemList);
328328
returnOperationResponse.Ok(MessageDefinitionType.LoadSucces,result.ItemList);
329-
}
330-
else
331-
{
329+
//}
330+
//else
331+
//{
332332

333-
returnOperationResponse.Ok(MessageDefinitionType.LoadSucces,treeList);
334-
}
333+
// return OperationResponse.Ok(MessageDefinitionType.LoadSucces, treeList);
334+
//}
335335
}
336336

337337

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp