mirror of
https://github.com/ThingsGateway/ThingsGateway.git
synced 2026-10-27 03:14:21 +08:00
整理格式
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user