整理格式

This commit is contained in:
Diego
2024-11-06 09:13:09 +08:00
parent e65d133dec
commit dbeddca263
4 changed files with 8 additions and 24 deletions
@@ -8,13 +8,13 @@
// QQ群:605534569
//------------------------------------------------------------------------------
using System.Reflection;
using System.Text;
using CSScripting;
using CSScriptLib;
using System.Reflection;
using System.Text;
using ThingsGateway.NewLife.Caching;
using ThingsGateway.NewLife.Threading;
@@ -12,27 +12,15 @@ using Microsoft.AspNetCore.Components.Authorization;
using System.Security.Claims;
using ThingsGateway.Admin.Application;
namespace ThingsGateway.Photino;
/// <inheritdoc/>
public class BlazorHybridAuthenticationStateProvider : AuthenticationStateProvider
{
private readonly ISysDictService _sysDictService;
private readonly ISysRoleService _sysRoleService;
private readonly ISysUserService _sysUserService;
private readonly IVerificatInfoService _verificatInfoService;
private readonly IAppService _appService;
public BlazorHybridAuthenticationStateProvider(IVerificatInfoService verificatInfoService,
IAppService appService,
ISysUserService sysUserService, ISysRoleService sysRoleService, ISysDictService sysDictService)
public BlazorHybridAuthenticationStateProvider(IAppService appService)
{
_sysUserService = sysUserService;
_sysRoleService = sysRoleService;
_sysDictService = sysDictService;
_verificatInfoService = verificatInfoService;
_appService = appService;
}
@@ -46,6 +34,4 @@ public class BlazorHybridAuthenticationStateProvider : AuthenticationStateProvid
{
return Task.FromResult(currentUser);
}
}
@@ -33,5 +33,4 @@ public class BlazorHybridAuthorizationHandler : BlazorAuthenticationStateProvide
return base.HandleAsync(context, httpContext);
}
}
+4 -5
View File
@@ -290,12 +290,11 @@ public class Startup : AppStartup
services.AddScoped<BlazorAppContext>(a =>
{
var sysResourceService = a.GetService<ISysResourceService>();
var userCenterService = a.GetService<IUserCenterService>();
var userService = a.GetService<ISysUserService>();
var appContext = new BlazorAppContext(sysResourceService, userCenterService, userService);
var appContext = new BlazorAppContext(
a.GetService<ISysResourceService>(),
a.GetService<IUserCenterService>(),
a.GetService<ISysUserService>());
appContext.TitleLocalizer = a.GetRequiredService<IStringLocalizer<ThingsGateway.Razor.MainLayout>>();
return appContext;
});