From dbeddca263fb9581bc4a4a7b8fed775b590db031 Mon Sep 17 00:00:00 2001 From: Diego <2248356998@qq.com> Date: Wed, 6 Nov 2024 09:13:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CSharpScriptEngineExtension.cs | 6 +++--- .../BlazorHybridAuthenticationStateProvider.cs | 16 +--------------- .../Services/BlazorHybridAuthorizationHandler.cs | 1 - src/ThingsGateway.Photino/Startup.cs | 9 ++++----- 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/Foundation/ThingsGateway.CSScript/CSharpScriptEngineExtension.cs b/src/Foundation/ThingsGateway.CSScript/CSharpScriptEngineExtension.cs index b1ec988a8..8aac0bd9c 100644 --- a/src/Foundation/ThingsGateway.CSScript/CSharpScriptEngineExtension.cs +++ b/src/Foundation/ThingsGateway.CSScript/CSharpScriptEngineExtension.cs @@ -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; diff --git a/src/ThingsGateway.Photino/Services/BlazorHybridAuthenticationStateProvider.cs b/src/ThingsGateway.Photino/Services/BlazorHybridAuthenticationStateProvider.cs index 80202d050..9e875b9ad 100644 --- a/src/ThingsGateway.Photino/Services/BlazorHybridAuthenticationStateProvider.cs +++ b/src/ThingsGateway.Photino/Services/BlazorHybridAuthenticationStateProvider.cs @@ -12,27 +12,15 @@ using Microsoft.AspNetCore.Components.Authorization; using System.Security.Claims; -using ThingsGateway.Admin.Application; - namespace ThingsGateway.Photino; /// 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); } - - } diff --git a/src/ThingsGateway.Photino/Services/BlazorHybridAuthorizationHandler.cs b/src/ThingsGateway.Photino/Services/BlazorHybridAuthorizationHandler.cs index ef84d41a2..f184d426d 100644 --- a/src/ThingsGateway.Photino/Services/BlazorHybridAuthorizationHandler.cs +++ b/src/ThingsGateway.Photino/Services/BlazorHybridAuthorizationHandler.cs @@ -33,5 +33,4 @@ public class BlazorHybridAuthorizationHandler : BlazorAuthenticationStateProvide return base.HandleAsync(context, httpContext); } - } diff --git a/src/ThingsGateway.Photino/Startup.cs b/src/ThingsGateway.Photino/Startup.cs index f4321f484..7c689c2e1 100644 --- a/src/ThingsGateway.Photino/Startup.cs +++ b/src/ThingsGateway.Photino/Startup.cs @@ -290,12 +290,11 @@ public class Startup : AppStartup services.AddScoped(a => { - var sysResourceService = a.GetService(); - var userCenterService = a.GetService(); - var userService = a.GetService(); - var appContext = new BlazorAppContext(sysResourceService, userCenterService, userService); + var appContext = new BlazorAppContext( + a.GetService(), + a.GetService(), + a.GetService()); appContext.TitleLocalizer = a.GetRequiredService>(); - return appContext; });