Compare commits
	
		
			24 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					605830edce | ||
| 
						 | 
					ca86441e05 | ||
| 
						 | 
					b30b876c5f | ||
| 
						 | 
					f95590b4cb | ||
| 
						 | 
					9921130406 | ||
| 
						 | 
					5c47589ca1 | ||
| 
						 | 
					048abfae2e | ||
| 
						 | 
					8e35c16edf | ||
| 
						 | 
					143b751213 | ||
| 
						 | 
					2cafe745b9 | ||
| 
						 | 
					210ac2c122 | ||
| 
						 | 
					4707ce6d58 | ||
| 
						 | 
					788a8b670d | ||
| 
						 | 
					5e4f0057e4 | ||
| 
						 | 
					2960c13ef1 | ||
| 
						 | 
					f11b7f7ab4 | ||
| 
						 | 
					9bb9cd7419 | ||
| 
						 | 
					ba008ef8ba | ||
| 
						 | 
					28b533decf | ||
| 
						 | 
					9ee638c2f1 | ||
| 
						 | 
					d90fdbaf35 | ||
| 
						 | 
					b55e3db736 | ||
| 
						 | 
					dbee8496cb | ||
| 
						 | 
					044e78bea9 | 
@@ -20,7 +20,6 @@ using System.Collections.Concurrent;
 | 
			
		||||
using ThingsGateway.Extension;
 | 
			
		||||
using ThingsGateway.FriendlyException;
 | 
			
		||||
using ThingsGateway.NewLife.Json.Extension;
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,12 +8,8 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using System.ComponentModel.DataAnnotations;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
[SugarTable("sys_dict", TableDescription = "字典表")]
 | 
			
		||||
 
 | 
			
		||||
@@ -8,10 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,12 +8,8 @@
 | 
			
		||||
// QQ群:605534569
 | 
			
		||||
// ------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using System.ComponentModel.DataAnnotations;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,11 +8,9 @@
 | 
			
		||||
// QQ群:605534569
 | 
			
		||||
// ------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using System.ComponentModel.DataAnnotations;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,16 +8,12 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using Microsoft.AspNetCore.Components.Routing;
 | 
			
		||||
 | 
			
		||||
using Newtonsoft.Json;
 | 
			
		||||
 | 
			
		||||
using System.ComponentModel.DataAnnotations;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,12 +8,8 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using System.ComponentModel.DataAnnotations;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,14 +8,9 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using Riok.Mapperly.Abstractions;
 | 
			
		||||
 | 
			
		||||
using System.ComponentModel.DataAnnotations;
 | 
			
		||||
using System.Diagnostics.CodeAnalysis;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
@@ -175,14 +170,14 @@ public class SysUser : BaseEntity
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    [SugarColumn(IsIgnore = true, IsJson = true)]
 | 
			
		||||
    [AutoGenerateColumn(Ignore = true)]
 | 
			
		||||
    public List<long> OrgAndPosIdList { get; set; } = new List<long>();
 | 
			
		||||
    public List<long>? OrgAndPosIdList { get; set; } = new List<long>();
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 主管信息
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    [SugarColumn(IsIgnore = true)]
 | 
			
		||||
    [AutoGenerateColumn(Ignore = true)]
 | 
			
		||||
    public UserSelectorOutput DirectorInfo { get; set; }
 | 
			
		||||
    public UserSelectorOutput? DirectorInfo { get; set; }
 | 
			
		||||
 | 
			
		||||
    #endregion
 | 
			
		||||
 | 
			
		||||
@@ -193,35 +188,35 @@ public class SysUser : BaseEntity
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    [SugarColumn(IsIgnore = true)]
 | 
			
		||||
    [AutoGenerateColumn(Ignore = true)]
 | 
			
		||||
    public Dictionary<string, List<string>> ButtonCodeList { get; set; } = new();
 | 
			
		||||
    public Dictionary<string, List<string>>? ButtonCodeList { get; set; } = new();
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 权限码集合
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    [SugarColumn(IsIgnore = true)]
 | 
			
		||||
    [AutoGenerateColumn(Ignore = true)]
 | 
			
		||||
    public HashSet<string> PermissionCodeList { get; set; } = new();
 | 
			
		||||
    public HashSet<string>? PermissionCodeList { get; set; } = new();
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 角色ID集合
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    [SugarColumn(IsIgnore = true)]
 | 
			
		||||
    [AutoGenerateColumn(Ignore = true)]
 | 
			
		||||
    public HashSet<long> RoleIdList { get; set; } = new();
 | 
			
		||||
    public HashSet<long>? RoleIdList { get; set; } = new();
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 机构及以下机构ID集合
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    [SugarColumn(IsIgnore = true)]
 | 
			
		||||
    [AutoGenerateColumn(Ignore = true)]
 | 
			
		||||
    public HashSet<long> ScopeOrgChildList { get; set; }
 | 
			
		||||
    public HashSet<long>? ScopeOrgChildList { get; set; }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 模块集合
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    [SugarColumn(IsIgnore = true)]
 | 
			
		||||
    [AutoGenerateColumn(Ignore = true)]
 | 
			
		||||
    public List<SysResource> ModuleList { get; set; } = new();
 | 
			
		||||
    public List<SysResource>? ModuleList { get; set; } = new();
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 租户Id
 | 
			
		||||
 
 | 
			
		||||
@@ -8,10 +8,7 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.List;
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
using ThingsGateway.Common.List;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -79,7 +79,7 @@ public class RequestAuditFilter : IAsyncActionFilter, IOrderedFilter
 | 
			
		||||
 | 
			
		||||
        logData.TimeOperationElapsedMilliseconds = timeOperation.ElapsedMilliseconds;
 | 
			
		||||
 | 
			
		||||
        var resultHttpContext = (resultContext as FilterContext).HttpContext;
 | 
			
		||||
        var resultHttpContext = (resultContext as Microsoft.AspNetCore.Mvc.Filters.FilterContext).HttpContext;
 | 
			
		||||
 | 
			
		||||
        // 获取 HttpContext 和 HttpRequest 对象
 | 
			
		||||
        var httpContext = context.HttpContext;
 | 
			
		||||
 
 | 
			
		||||
@@ -8,4 +8,15 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
global using ThingsGateway.NewLife.Extension;
 | 
			
		||||
global using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
global using Microsoft.Extensions.Localization;
 | 
			
		||||
global using Microsoft.Extensions.Options;
 | 
			
		||||
 | 
			
		||||
global using System.Diagnostics.CodeAnalysis;
 | 
			
		||||
global using System.Globalization;
 | 
			
		||||
 | 
			
		||||
global using ThingsGateway.Common;
 | 
			
		||||
global using ThingsGateway.DB;
 | 
			
		||||
global using ThingsGateway.NewLife.Extension;
 | 
			
		||||
global using ThingsGateway.SqlSugar;
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.NewLife;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 
 | 
			
		||||
@@ -9,9 +9,7 @@
 | 
			
		||||
// ------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using Microsoft.Extensions.Hosting;
 | 
			
		||||
using Microsoft.Extensions.Localization;
 | 
			
		||||
using Microsoft.Extensions.Logging;
 | 
			
		||||
using Microsoft.Extensions.Options;
 | 
			
		||||
 | 
			
		||||
using System.Runtime.InteropServices;
 | 
			
		||||
 | 
			
		||||
@@ -20,7 +18,6 @@ using ThingsGateway.NewLife;
 | 
			
		||||
using ThingsGateway.NewLife.Caching;
 | 
			
		||||
using ThingsGateway.NewLife.Threading;
 | 
			
		||||
using ThingsGateway.Schedule;
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
@@ -61,7 +58,7 @@ public class HardwareJob : IJob, IHardwareJob
 | 
			
		||||
        var historyHardwareInfos = MemoryCache.Get<List<HistoryHardwareInfo>>(CacheKey);
 | 
			
		||||
        if (historyHardwareInfos == null)
 | 
			
		||||
        {
 | 
			
		||||
            using var db = DbContext.GetDB<HistoryHardwareInfo>(); ;
 | 
			
		||||
            using var db = DbContext.GetDB<HistoryHardwareInfo>();
 | 
			
		||||
            historyHardwareInfos = await db.Queryable<HistoryHardwareInfo>().Where(a => a.Date > DateTime.Now.AddDays(-3)).Take(1000).ToListAsync().ConfigureAwait(false);
 | 
			
		||||
 | 
			
		||||
            MemoryCache.Set(CacheKey, historyHardwareInfos);
 | 
			
		||||
@@ -132,7 +129,7 @@ public class HardwareJob : IJob, IHardwareJob
 | 
			
		||||
                                CpuUsage = (HardwareInfo.MachineInfo.CpuRate * 100).ToInt(),
 | 
			
		||||
                                Temperature = (HardwareInfo.MachineInfo.Temperature).ToInt(),
 | 
			
		||||
                            };
 | 
			
		||||
                            await _db.Insertable(his).ExecuteCommandAsync(stoppingToken).ConfigureAwait(false);
 | 
			
		||||
                            await _db.InsertableT(his).ExecuteCommandAsync(stoppingToken).ConfigureAwait(false);
 | 
			
		||||
                            MemoryCache.Remove(CacheKey);
 | 
			
		||||
                        }
 | 
			
		||||
                        var sevenDaysAgo = TimerX.Now.AddDays(-HardwareInfoOptions.DaysAgo);
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <inheritdoc/>
 | 
			
		||||
 
 | 
			
		||||
@@ -15,8 +15,6 @@ using ThingsGateway.Extension;
 | 
			
		||||
using ThingsGateway.FriendlyException;
 | 
			
		||||
using ThingsGateway.Logging;
 | 
			
		||||
using ThingsGateway.NewLife.Json.Extension;
 | 
			
		||||
using ThingsGateway.Razor;
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using Riok.Mapperly.Abstractions;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,6 @@ using Microsoft.AspNetCore.Http;
 | 
			
		||||
using Microsoft.Extensions.DependencyInjection;
 | 
			
		||||
using Microsoft.Extensions.Hosting;
 | 
			
		||||
using Microsoft.Extensions.Logging;
 | 
			
		||||
using Microsoft.Extensions.Options;
 | 
			
		||||
 | 
			
		||||
using System.Collections.Concurrent;
 | 
			
		||||
using System.Security.Claims;
 | 
			
		||||
@@ -211,7 +210,7 @@ public class AdminOAuthHandler<TOptions>(
 | 
			
		||||
 | 
			
		||||
        using var db = DbContext.GetDB<SysUser>();
 | 
			
		||||
        //更新用户登录信息
 | 
			
		||||
        if (await db.Updateable(sysUser).UpdateColumns(it => new
 | 
			
		||||
        if (await db.UpdateableT(sysUser).UpdateColumns(it => new
 | 
			
		||||
        {
 | 
			
		||||
            it.LastLoginIp,
 | 
			
		||||
            it.LastLoginTime,
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,6 @@
 | 
			
		||||
 | 
			
		||||
using Microsoft.AspNetCore.Authentication;
 | 
			
		||||
using Microsoft.AspNetCore.Authorization;
 | 
			
		||||
using Microsoft.AspNetCore.Components;
 | 
			
		||||
using Microsoft.AspNetCore.Http;
 | 
			
		||||
 | 
			
		||||
using System.Security.Claims;
 | 
			
		||||
@@ -116,7 +115,7 @@ public class BlazorAuthenticationHandler : AppAuthorizeHandler
 | 
			
		||||
                {
 | 
			
		||||
                    // 路由名称
 | 
			
		||||
                    var routeName = routeData.PageType.CustomAttributes.FirstOrDefault(x =>
 | 
			
		||||
                        x.AttributeType == typeof(RouteAttribute))?.ConstructorArguments?[0].Value as string;
 | 
			
		||||
                        x.AttributeType == typeof(Microsoft.AspNetCore.Components.RouteAttribute))?.ConstructorArguments?[0].Value as string;
 | 
			
		||||
                    if (routeName == null) return true;
 | 
			
		||||
 | 
			
		||||
                    if ((!user.PermissionCodeList.Contains(routeName.CutStart("/")) && !user.PermissionCodeList.Contains(routeName))) //如果当前路由信息不包含在角色授权路由列表中则认证失败
 | 
			
		||||
 
 | 
			
		||||
@@ -11,11 +11,9 @@
 | 
			
		||||
using Microsoft.AspNetCore.Http;
 | 
			
		||||
using Microsoft.AspNetCore.Mvc;
 | 
			
		||||
using Microsoft.AspNetCore.Mvc.Filters;
 | 
			
		||||
using Microsoft.Extensions.Localization;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.DataValidation;
 | 
			
		||||
using ThingsGateway.FriendlyException;
 | 
			
		||||
using ThingsGateway.Razor;
 | 
			
		||||
using ThingsGateway.UnifyResult;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 
 | 
			
		||||
@@ -9,19 +9,15 @@
 | 
			
		||||
// ------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using Microsoft.AspNetCore.Authorization;
 | 
			
		||||
using Microsoft.AspNetCore.Mvc.ApiExplorer;
 | 
			
		||||
using Microsoft.AspNetCore.Mvc.Controllers;
 | 
			
		||||
using Microsoft.Extensions.Options;
 | 
			
		||||
 | 
			
		||||
using Swashbuckle.AspNetCore.SwaggerGen;
 | 
			
		||||
 | 
			
		||||
using System.Globalization;
 | 
			
		||||
using System.Reflection;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Extension;
 | 
			
		||||
using ThingsGateway.Common.Extension;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,6 @@
 | 
			
		||||
 | 
			
		||||
using Microsoft.AspNetCore.Authentication.Cookies;
 | 
			
		||||
using Microsoft.AspNetCore.Http;
 | 
			
		||||
using Microsoft.Extensions.Localization;
 | 
			
		||||
 | 
			
		||||
using System.Security.Claims;
 | 
			
		||||
 | 
			
		||||
@@ -326,7 +325,7 @@ public class AuthService : IAuthService
 | 
			
		||||
 | 
			
		||||
        using var db = DbContext.GetDB<SysUser>();
 | 
			
		||||
        //更新用户登录信息
 | 
			
		||||
        if (await db.Updateable(sysUser).UpdateColumns(it => new
 | 
			
		||||
        if (await db.UpdateableT(sysUser).UpdateColumns(it => new
 | 
			
		||||
        {
 | 
			
		||||
            it.LastLoginIp,
 | 
			
		||||
            it.LastLoginTime,
 | 
			
		||||
 
 | 
			
		||||
@@ -58,7 +58,7 @@ public class LoginOutput
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 模块列表
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public IEnumerable<SysResource> ModuleList { get; set; } = Enumerable.Empty<SysResource>();
 | 
			
		||||
    public IEnumerable<SysResource>? ModuleList { get; set; } = Enumerable.Empty<SysResource>();
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 刷新Token
 | 
			
		||||
 
 | 
			
		||||
@@ -15,17 +15,17 @@ public class AppConfig
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 登录策略
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public LoginPolicy LoginPolicy { get; set; }
 | 
			
		||||
    public LoginPolicy? LoginPolicy { get; set; }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 页面策略
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public PagePolicy PagePolicy { get; set; }
 | 
			
		||||
    public PagePolicy? PagePolicy { get; set; }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 密码策略
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public PasswordPolicy PasswordPolicy { get; set; }
 | 
			
		||||
    public PasswordPolicy? PasswordPolicy { get; set; }
 | 
			
		||||
 | 
			
		||||
    public WebsitePolicy WebsitePolicy { get; set; }
 | 
			
		||||
    public WebsitePolicy? WebsitePolicy { get; set; }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -15,5 +15,5 @@ public class PagePolicy
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 系统默认快捷方式菜单ID列表
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public List<long> Shortcuts { get; set; } = new();
 | 
			
		||||
    public List<long>? Shortcuts { get; set; } = new();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,11 +8,8 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.FriendlyException;
 | 
			
		||||
using ThingsGateway.NewLife.Json.Extension;
 | 
			
		||||
using ThingsGateway.Razor;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,6 @@
 | 
			
		||||
 | 
			
		||||
using Microsoft.AspNetCore.Components.Forms;
 | 
			
		||||
using Microsoft.AspNetCore.Mvc;
 | 
			
		||||
using Microsoft.Extensions.Localization;
 | 
			
		||||
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Web;
 | 
			
		||||
@@ -90,7 +89,4 @@ internal sealed class FileService : IFileService
 | 
			
		||||
        if (!allowTypeS.Contains(fileSuffix)) throw Oops.Bah(_localizer["FileTypeError", fileSuffix]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #region 方法
 | 
			
		||||
 | 
			
		||||
    #endregion 方法
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Extension.Generic;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,12 +8,8 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using System.Data;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
internal sealed class SysOperateLogService : BaseService<SysOperateLog>, ISysOperateLogService
 | 
			
		||||
 
 | 
			
		||||
@@ -8,10 +8,6 @@
 | 
			
		||||
// QQ群:605534569
 | 
			
		||||
// ------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,11 +8,8 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Extension.Generic;
 | 
			
		||||
using ThingsGateway.FriendlyException;
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,10 +8,6 @@
 | 
			
		||||
// QQ群:605534569
 | 
			
		||||
// ------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,10 +8,7 @@
 | 
			
		||||
// QQ群:605534569
 | 
			
		||||
// ------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.FriendlyException;
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -137,7 +137,7 @@ internal sealed class RelationService : BaseService<SysRelation>, IRelationServi
 | 
			
		||||
        {
 | 
			
		||||
            if (clear)
 | 
			
		||||
                await db.Deleteable<SysRelation>().Where(it => it.ObjectId == objectId && it.Category == category).ExecuteCommandAsync().ConfigureAwait(false);//删除老的
 | 
			
		||||
            await db.Insertable(sysRelation).ExecuteCommandAsync().ConfigureAwait(false);//添加新的
 | 
			
		||||
            await db.InsertableT(sysRelation).ExecuteCommandAsync().ConfigureAwait(false);//添加新的
 | 
			
		||||
        }).ConfigureAwait(false);
 | 
			
		||||
        if (result.IsSuccess)//如果成功了
 | 
			
		||||
        {
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using System.ComponentModel.DataAnnotations;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Extension.Generic;
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,12 +8,9 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using Microsoft.Extensions.DependencyInjection;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.FriendlyException;
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
@@ -66,7 +63,7 @@ internal sealed class SysResourceService : BaseService<SysResource>, ISysResourc
 | 
			
		||||
        var resource = resourceList.First(a => a.Id == id);
 | 
			
		||||
        resource.ParentId = parentMenuId;
 | 
			
		||||
        using var db = GetDB();
 | 
			
		||||
        var result = await db.Updateable(resource).ExecuteCommandAsync().ConfigureAwait(false);
 | 
			
		||||
        var result = await db.UpdateableT(resource).ExecuteCommandAsync().ConfigureAwait(false);
 | 
			
		||||
        RefreshCache();//刷新缓存
 | 
			
		||||
        _relationService.RefreshCache(RelationCategoryEnum.RoleHasResource);//关系表刷新缓存
 | 
			
		||||
        _relationService.RefreshCache(RelationCategoryEnum.UserHasResource);//关系表刷新缓存
 | 
			
		||||
@@ -198,7 +195,7 @@ internal sealed class SysResourceService : BaseService<SysResource>, ISysResourc
 | 
			
		||||
 | 
			
		||||
        if (type == ItemChangedType.Add)
 | 
			
		||||
        {
 | 
			
		||||
            var result = await db.Insertable(input).ExecuteCommandAsync().ConfigureAwait(false);
 | 
			
		||||
            var result = await db.InsertableT(input).ExecuteCommandAsync().ConfigureAwait(false);
 | 
			
		||||
            RefreshCache();//刷新缓存
 | 
			
		||||
            return result > 0;
 | 
			
		||||
        }
 | 
			
		||||
@@ -223,7 +220,7 @@ internal sealed class SysResourceService : BaseService<SysResource>, ISysResourc
 | 
			
		||||
            //事务
 | 
			
		||||
            var result = await db.UseTranAsync(async () =>
 | 
			
		||||
            {
 | 
			
		||||
                await db.Updateable(input).ExecuteCommandAsync().ConfigureAwait(false);//更新数据
 | 
			
		||||
                await db.UpdateableT(input).ExecuteCommandAsync().ConfigureAwait(false);//更新数据
 | 
			
		||||
                if (permissions.Count > 0)//如果权限列表大于0就更新
 | 
			
		||||
                {
 | 
			
		||||
                    await db.Updateable(permissions).ExecuteCommandAsync().ConfigureAwait(false);//更新关系表
 | 
			
		||||
 
 | 
			
		||||
@@ -8,10 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,11 +8,8 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.FriendlyException;
 | 
			
		||||
using ThingsGateway.NewLife.Json.Extension;
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
public interface ISessionService
 | 
			
		||||
 
 | 
			
		||||
@@ -8,10 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
internal sealed class SessionService : BaseService<SysUser>, ISessionService
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,14 +8,12 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Common.Extension;
 | 
			
		||||
using ThingsGateway.Common.Extension.Generic;
 | 
			
		||||
using ThingsGateway.DataEncryption;
 | 
			
		||||
using ThingsGateway.Extension;
 | 
			
		||||
using ThingsGateway.Extension.Generic;
 | 
			
		||||
using ThingsGateway.FriendlyException;
 | 
			
		||||
using ThingsGateway.NewLife.Json.Extension;
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
@@ -472,7 +470,7 @@ internal sealed class SysUserService : BaseService<SysUser>, ISysUserService
 | 
			
		||||
 | 
			
		||||
                var sysUser = input;//实体转换
 | 
			
		||||
                using var db = GetDB();
 | 
			
		||||
                var result = await db.Updateable(sysUser).IgnoreColumns(it =>
 | 
			
		||||
                var result = await db.UpdateableT(sysUser).IgnoreColumns(it =>
 | 
			
		||||
                        new
 | 
			
		||||
                        {
 | 
			
		||||
                            //忽略更新字段
 | 
			
		||||
 
 | 
			
		||||
@@ -8,4 +8,3 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 
 | 
			
		||||
@@ -8,16 +8,13 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using System.Text.RegularExpressions;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Common.Extension;
 | 
			
		||||
using ThingsGateway.DataEncryption;
 | 
			
		||||
using ThingsGateway.Extension;
 | 
			
		||||
using ThingsGateway.Extension.Generic;
 | 
			
		||||
using ThingsGateway.FriendlyException;
 | 
			
		||||
using ThingsGateway.NewLife.Json.Extension;
 | 
			
		||||
using ThingsGateway.Razor;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using Microsoft.Extensions.DependencyInjection;
 | 
			
		||||
using Microsoft.Extensions.Logging;
 | 
			
		||||
 | 
			
		||||
@@ -43,7 +41,6 @@ public class Startup : AppStartup
 | 
			
		||||
 | 
			
		||||
        services.AddSingleton<IVerificatInfoService, VerificatInfoService>();
 | 
			
		||||
 | 
			
		||||
        services.AddScoped<IAuthRazorService, AuthRazorService>();
 | 
			
		||||
        services.AddSingleton<IApiPermissionService, ApiPermissionService>();
 | 
			
		||||
        services.AddSingleton<IFileService, FileService>();
 | 
			
		||||
        services.AddSingleton<IImportExportService, ImportExportService>();
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.NewLife;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <inheritdoc/>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <inheritdoc/>
 | 
			
		||||
@@ -26,8 +24,6 @@ public static class OrgUtil
 | 
			
		||||
        var data = items
 | 
			
		||||
        .Select((item, index) =>
 | 
			
		||||
            new SelectedItem(item.Id.ToString(), item.Name)
 | 
			
		||||
            {
 | 
			
		||||
            }
 | 
			
		||||
        ).ToList();
 | 
			
		||||
        return data;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <inheritdoc/>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <inheritdoc/>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,6 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
/// <inheritdoc/>
 | 
			
		||||
@@ -27,8 +25,6 @@ public static class UserUtil
 | 
			
		||||
        var data = items
 | 
			
		||||
        .Select((item, index) =>
 | 
			
		||||
            new SelectedItem(item.Id.ToString(), item.Account)
 | 
			
		||||
            {
 | 
			
		||||
            }
 | 
			
		||||
        ).ToList();
 | 
			
		||||
        return data;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,6 @@
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Extension.Generic;
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,6 @@
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.NewLife.Extension;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Razor;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -55,7 +55,7 @@ public partial class SysSignalRLoginConnectionHub : ComponentBase, IAsyncDisposa
 | 
			
		||||
                                return true;
 | 
			
		||||
                            };
 | 
			
		||||
                        }
 | 
			
		||||
                        ;
 | 
			
		||||
 | 
			
		||||
                        return message;
 | 
			
		||||
                    };
 | 
			
		||||
                    foreach (var item in App.User?.Claims ?? new List<Claim>())
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,6 @@
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.NewLife;
 | 
			
		||||
using ThingsGateway.NewLife.Extension;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Razor;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,10 @@ global using Microsoft.Extensions.Options;
 | 
			
		||||
 | 
			
		||||
global using System.Diagnostics.CodeAnalysis;
 | 
			
		||||
 | 
			
		||||
global using ThingsGateway.Common;
 | 
			
		||||
global using ThingsGateway.DB;
 | 
			
		||||
global using ThingsGateway.NewLife.Extension;
 | 
			
		||||
global using ThingsGateway.Razor;
 | 
			
		||||
 | 
			
		||||
global using ThingsGateway.SqlSugar;
 | 
			
		||||
[assembly: SuppressMessage("Reliability", "CA2007", Justification = "<挂起>", Scope = "module")]
 | 
			
		||||
[assembly: GlobalGenerateSetParametersAsync(true)]
 | 
			
		||||
@@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Components.Forms;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.Extension.Generic;
 | 
			
		||||
using ThingsGateway.NewLife.Extension;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Razor;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -9,8 +9,6 @@
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.NewLife.Extension;
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Razor;
 | 
			
		||||
 | 
			
		||||
@@ -49,7 +47,7 @@ public partial class OrgTree : IDisposable
 | 
			
		||||
    private List<TreeViewItem<SysOrg>> ZItem;
 | 
			
		||||
    protected override async Task OnInitializedAsync()
 | 
			
		||||
    {
 | 
			
		||||
        ZItem = new List<TreeViewItem<SysOrg>>() {new TreeViewItem<SysOrg>(new SysOrg(){ })
 | 
			
		||||
        ZItem = new List<TreeViewItem<SysOrg>>() {new TreeViewItem<SysOrg>(new SysOrg())
 | 
			
		||||
        {
 | 
			
		||||
            Text = AdminLocalizer["All"],
 | 
			
		||||
            IsActive = Value == 0,
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,6 @@
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Razor;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -9,8 +9,6 @@
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.NewLife.Extension;
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Razor;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -9,8 +9,6 @@
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.NewLife.Extension;
 | 
			
		||||
using ThingsGateway.SqlSugar;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Razor;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,6 @@
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.Extension.Generic;
 | 
			
		||||
using ThingsGateway.NewLife.Extension;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Razor;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,6 @@
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.NewLife.Extension;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Razor;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,6 @@
 | 
			
		||||
using Microsoft.AspNetCore.Components.Forms;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.NewLife.Extension;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Razor;
 | 
			
		||||
 | 
			
		||||
@@ -36,7 +35,7 @@ public partial class SysUserEdit
 | 
			
		||||
    protected override async Task OnInitializedAsync()
 | 
			
		||||
    {
 | 
			
		||||
        BoolItems = LocalizerUtil.GetBoolItems(Model.GetType(), nameof(Model.Status));
 | 
			
		||||
        var items = await SysPositionService.SelectorAsync(new PositionSelectorInput() { });
 | 
			
		||||
        var items = await SysPositionService.SelectorAsync(new PositionSelectorInput());
 | 
			
		||||
        Items = PositionUtil.BuildCascaderItemList(items);
 | 
			
		||||
        ModuleSelectedItems = ResourceUtil.BuildModuleSelectList((await SysResourceService.GetAllAsync())).ToList();
 | 
			
		||||
        await InvokeAsync(StateHasChanged);
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,6 @@
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.NewLife.Extension;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Razor;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,13 +8,11 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using BootstrapBlazor.Components;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.NewLife.Json.Extension;
 | 
			
		||||
using ThingsGateway.Razor;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
namespace ThingsGateway.Admin.Razor;
 | 
			
		||||
 | 
			
		||||
internal sealed class AuthRazorService : IAuthRazorService
 | 
			
		||||
{
 | 
			
		||||
@@ -8,9 +8,9 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Razor;
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
namespace ThingsGateway.Admin.Razor;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
public class HybridAuthRazorService : IAuthRazorService
 | 
			
		||||
@@ -8,9 +8,9 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Razor;
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
namespace ThingsGateway.Admin.Razor;
 | 
			
		||||
 | 
			
		||||
public interface IAuthRazorService
 | 
			
		||||
{
 | 
			
		||||
@@ -18,6 +18,7 @@ public class Startup : AppStartup
 | 
			
		||||
    public void Configure(IServiceCollection services)
 | 
			
		||||
    {
 | 
			
		||||
        services.AddScoped<IMenuService, MenuService>();
 | 
			
		||||
        services.AddScoped<IAuthRazorService, AuthRazorService>();
 | 
			
		||||
        services.AddBootstrapBlazorTableExportService();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -37,6 +37,7 @@
 | 
			
		||||
 | 
			
		||||
	<ItemGroup>
 | 
			
		||||
		<ProjectReference Include="..\BlazorSetParametersAsyncGenerator\BlazorSetParametersAsyncGenerator.csproj" PrivateAssets="all" OutputItemType="Analyzer" />
 | 
			
		||||
		<ProjectReference Include="..\ThingsGateway.Razor\ThingsGateway.Razor.csproj" />
 | 
			
		||||
	</ItemGroup>
 | 
			
		||||
	
 | 
			
		||||
</Project>
 | 
			
		||||
 
 | 
			
		||||
@@ -27,8 +27,6 @@ public static class ResourceUtil
 | 
			
		||||
        var data = items.Where(a => a.Category == ResourceCategoryEnum.Menu)
 | 
			
		||||
        .Select((item, index) =>
 | 
			
		||||
            new SelectedItem(item.Id.ToString(), item.Title)
 | 
			
		||||
            {
 | 
			
		||||
            }
 | 
			
		||||
        ).ToList();
 | 
			
		||||
        return data;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -15,5 +15,5 @@
 | 
			
		||||
 | 
			
		||||
@using BootstrapBlazor.Components
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@using ThingsGateway.Common.Extension;
 | 
			
		||||
@using ThingsGateway.Razor;
 | 
			
		||||
@@ -14,6 +14,7 @@
 | 
			
		||||
      "ThingsGateway.SqlSugar",
 | 
			
		||||
      "ThingsGateway.Admin.Application",
 | 
			
		||||
      "ThingsGateway.Admin.Razor",
 | 
			
		||||
      "ThingsGateway.Common",
 | 
			
		||||
      "ThingsGateway.DB",
 | 
			
		||||
      "ThingsGateway.Razor"
 | 
			
		||||
    ]
 | 
			
		||||
 
 | 
			
		||||
@@ -14,6 +14,7 @@
 | 
			
		||||
      "ThingsGateway.SqlSugar",
 | 
			
		||||
      "ThingsGateway.Admin.Application",
 | 
			
		||||
      "ThingsGateway.Admin.Razor",
 | 
			
		||||
      "ThingsGateway.Common",
 | 
			
		||||
      "ThingsGateway.DB",
 | 
			
		||||
      "ThingsGateway.Razor"
 | 
			
		||||
    ]
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,7 @@
 | 
			
		||||
@using ThingsGateway.Admin.Razor
 | 
			
		||||
@using ThingsGateway.Extension;
 | 
			
		||||
@using ThingsGateway.Razor
 | 
			
		||||
@using ThingsGateway.Common.Extension;
 | 
			
		||||
 | 
			
		||||
<div class="login h-100">
 | 
			
		||||
    @* 左侧说明 *@
 | 
			
		||||
 
 | 
			
		||||
@@ -19,6 +19,8 @@ using Microsoft.Extensions.Options;
 | 
			
		||||
using System.Diagnostics.CodeAnalysis;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.Admin.Razor;
 | 
			
		||||
using ThingsGateway.Common;
 | 
			
		||||
using ThingsGateway.DataEncryption;
 | 
			
		||||
using ThingsGateway.NewLife.Extension;
 | 
			
		||||
using ThingsGateway.Razor;
 | 
			
		||||
 
 | 
			
		||||
@@ -17,9 +17,11 @@
 | 
			
		||||
@using Microsoft.AspNetCore.Authorization
 | 
			
		||||
@using Microsoft.AspNetCore.Components.Authorization
 | 
			
		||||
@using Microsoft.Extensions.Localization
 | 
			
		||||
@using ThingsGateway.Common.Extension;
 | 
			
		||||
 | 
			
		||||
@using System.ComponentModel
 | 
			
		||||
@using System.ComponentModel.DataAnnotations
 | 
			
		||||
@using ThingsGateway.DB;
 | 
			
		||||
 | 
			
		||||
@inject NavigationManager NavigationManager
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -19,6 +19,7 @@ using System.Diagnostics.CodeAnalysis;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.Admin.Razor;
 | 
			
		||||
using ThingsGateway.Common;
 | 
			
		||||
using ThingsGateway.Razor;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.AdminServer;
 | 
			
		||||
@@ -78,9 +79,7 @@ public partial class MainLayout : IDisposable
 | 
			
		||||
            IsScrolling = false,
 | 
			
		||||
            Title = Localizer["UserCenter"],
 | 
			
		||||
            ShowFooter = false,
 | 
			
		||||
            Component = BootstrapDynamicComponent.CreateComponent<UserCenterPage>(new Dictionary<string, object?>()
 | 
			
		||||
            {
 | 
			
		||||
            })
 | 
			
		||||
            Component = BootstrapDynamicComponent.CreateComponent<UserCenterPage>(new Dictionary<string, object?>())
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -14,6 +14,7 @@ using System.Runtime.InteropServices;
 | 
			
		||||
using System.Text;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.DB;
 | 
			
		||||
using ThingsGateway.NewLife.Log;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.AdminServer;
 | 
			
		||||
@@ -30,7 +31,7 @@ public class Program
 | 
			
		||||
        // 增加中文编码支持
 | 
			
		||||
        Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
 | 
			
		||||
 | 
			
		||||
        ThingsGateway.Admin.Application.ClaimConst.Scheme = $"{typeof(Program).Assembly.GetName().Name}{SchemeHelper.GetOrCreate()}";
 | 
			
		||||
        ClaimConst.Scheme = $"{typeof(Program).Assembly.GetName().Name}{SchemeHelper.GetOrCreate()}";
 | 
			
		||||
 | 
			
		||||
        #region 控制台输出Logo
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -40,6 +40,7 @@ public class SingleFilePublish : ISingleFilePublish
 | 
			
		||||
            "ThingsGateway.NewLife.X",
 | 
			
		||||
            "ThingsGateway.Razor",
 | 
			
		||||
            "ThingsGateway.Admin.Razor"   ,
 | 
			
		||||
            "ThingsGateway.Common",
 | 
			
		||||
             "ThingsGateway.DB",
 | 
			
		||||
            "ThingsGateway.Admin.Application",
 | 
			
		||||
            "ThingsGateway.SqlSugar",
 | 
			
		||||
 
 | 
			
		||||
@@ -26,6 +26,7 @@ using System.Text.Unicode;
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.Admin.Application;
 | 
			
		||||
using ThingsGateway.Admin.Razor;
 | 
			
		||||
using ThingsGateway.DB;
 | 
			
		||||
using ThingsGateway.VirtualFileServer;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.AdminServer;
 | 
			
		||||
@@ -81,7 +82,7 @@ public class Startup : AppStartup
 | 
			
		||||
            // setting.DateParseHandling = DateParseHandling.None; // 解决DateTimeOffset异常
 | 
			
		||||
            // setting.Converters.Add(new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }); // 解决DateTimeOffset异常
 | 
			
		||||
        }
 | 
			
		||||
        ;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        services.AddMvcFilter<RequestAuditFilter>();
 | 
			
		||||
        services.AddControllers()
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@
 | 
			
		||||
		<TargetFrameworks>net8.0;net9.0;</TargetFrameworks>
 | 
			
		||||
	</PropertyGroup>
 | 
			
		||||
 | 
			
		||||
	<Import Project="Admin.targets" Condition=" '$(Configuration)' != 'Debug' " />
 | 
			
		||||
	<!--<Import Project="Admin.targets" Condition=" '$(Configuration)' != 'Debug' " />-->
 | 
			
		||||
	<PropertyGroup>
 | 
			
		||||
		<OpenApiGenerateDocuments>false</OpenApiGenerateDocuments>
 | 
			
		||||
		<SatelliteResourceLanguages>zh-Hans;en-US</SatelliteResourceLanguages>
 | 
			
		||||
@@ -26,7 +26,7 @@
 | 
			
		||||
		<!--<PlatformTarget>x86</PlatformTarget>-->
 | 
			
		||||
	</PropertyGroup>
 | 
			
		||||
 | 
			
		||||
	<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
 | 
			
		||||
	<ItemGroup>
 | 
			
		||||
		<ProjectReference Include="..\ThingsGateway.Admin.Razor\ThingsGateway.Admin.Razor.csproj" />
 | 
			
		||||
	</ItemGroup>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
namespace ThingsGateway.Common;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
/// 忽略Excel导入导出
 | 
			
		||||
@@ -8,7 +8,7 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Admin.Application;
 | 
			
		||||
namespace ThingsGateway.Common;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
/// 种子数据忽略新增
 | 
			
		||||
@@ -10,13 +10,12 @@
 | 
			
		||||
 | 
			
		||||
using System.Collections;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.List;
 | 
			
		||||
namespace ThingsGateway.Common.List;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
/// 线程安全的List,其基本操作和List一致。
 | 
			
		||||
/// </summary>
 | 
			
		||||
/// <typeparam name="T"></typeparam>
 | 
			
		||||
[ThingsGateway.DependencyInjection.SuppressSniffer]
 | 
			
		||||
public class ConcurrentList<T> : IList<T>, IReadOnlyList<T>
 | 
			
		||||
{
 | 
			
		||||
    private readonly List<T> m_list;
 | 
			
		||||
@@ -12,7 +12,7 @@
 | 
			
		||||
 | 
			
		||||
//using System.Text;
 | 
			
		||||
 | 
			
		||||
//namespace ThingsGateway.Razor;
 | 
			
		||||
//namespace ThingsGateway.Common;
 | 
			
		||||
 | 
			
		||||
///// <summary>
 | 
			
		||||
///// <see cref="Encoding"/> Master规则
 | 
			
		||||
@@ -8,7 +8,7 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Razor;
 | 
			
		||||
namespace ThingsGateway.Common;
 | 
			
		||||
 | 
			
		||||
public interface IDriverUIBase
 | 
			
		||||
{
 | 
			
		||||
@@ -8,9 +8,9 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
using ThingsGateway.List;
 | 
			
		||||
using ThingsGateway.Common.List;
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway;
 | 
			
		||||
namespace ThingsGateway.Common;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
/// 文件导入通用输出
 | 
			
		||||
@@ -8,7 +8,7 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway.Razor;
 | 
			
		||||
namespace ThingsGateway.Common;
 | 
			
		||||
 | 
			
		||||
public class ModelValueValidateForm
 | 
			
		||||
{
 | 
			
		||||
@@ -8,7 +8,7 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway;
 | 
			
		||||
namespace ThingsGateway.Common;
 | 
			
		||||
 | 
			
		||||
using System;
 | 
			
		||||
using System.Text;
 | 
			
		||||
@@ -16,7 +16,6 @@ using System.Text;
 | 
			
		||||
/// <summary>
 | 
			
		||||
/// 随机数
 | 
			
		||||
/// </summary>
 | 
			
		||||
[ThingsGateway.DependencyInjection.SuppressSniffer]
 | 
			
		||||
public static class RandomHelper
 | 
			
		||||
{
 | 
			
		||||
    /// <summary>
 | 
			
		||||
@@ -8,7 +8,7 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway;
 | 
			
		||||
namespace ThingsGateway.Common;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
/// 全局分页查询输入参数
 | 
			
		||||
@@ -8,7 +8,7 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway;
 | 
			
		||||
namespace ThingsGateway.Common;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
/// 全局分页查询输入参数
 | 
			
		||||
@@ -8,7 +8,7 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway;
 | 
			
		||||
namespace ThingsGateway.Common;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
/// 主键id基类
 | 
			
		||||
@@ -8,7 +8,7 @@
 | 
			
		||||
//  QQ群:605534569
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
namespace ThingsGateway;
 | 
			
		||||
namespace ThingsGateway.Common;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
/// SqlSugar 分页泛型集合
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user