😎清理代码

This commit is contained in:
zuohuaijun 2025-09-04 14:05:51 +08:00
parent be345588b4
commit fff4cca1bd
4 changed files with 6 additions and 7 deletions

View File

@ -4,7 +4,6 @@
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
global using Admin.NET.Application.Entity;
global using Admin.NET.Core;
global using Admin.NET.Core.Service;
global using Furion;
@ -12,7 +11,6 @@ global using Furion.DependencyInjection;
global using Furion.DynamicApiController;
global using Furion.EventBus;
global using Furion.FriendlyException;
global using Mapster;
global using Microsoft.AspNetCore.Authorization;
global using Microsoft.AspNetCore.Mvc;
global using Microsoft.Extensions.DependencyInjection;

View File

@ -53,7 +53,7 @@
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.11.0" />
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.13.0" />
<PackageReference Include="SqlSugar.MongoDbCore" Version="5.1.4.255" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.200" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.201" />
<PackageReference Include="SSH.NET" Version="2025.0.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.6.7" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />

View File

@ -207,7 +207,7 @@ public class DatabaseLoggingWriter : IDatabaseLoggingWriter, IDisposable
if (string.IsNullOrWhiteSpace(result.Account) && result.UserId != null)
{
var userManager = userManger.GetOrRefresh(result.UserId);
result.Account =userManager?.TenantId?.ToString();
result.Account = userManager?.TenantId?.ToString();
result.RealName = userManager?.RealName;
result.Account = userManager?.Account;
}

View File

@ -306,8 +306,8 @@ public class SysAuthService : IDynamicApiController, ITransient
if (!maxDataScope.Any()) maxDataScope = [DataScopeEnum.Self];
var orgIds = GetUserOrgIdList(user, roleIds);
var permissions = GetUserPermissions(user, roleIds);
var unauthorizedPermissions = GetUserUnPermissions(user, roleIds);
var permissions = GetUserPermissions(user, roleIds);
var unauthorizedPermissions = GetUserUnPermissions(user, roleIds);
// 缓存用户状态
_userManager.Set(new()
@ -518,6 +518,7 @@ public class SysAuthService : IDynamicApiController, ITransient
case ApiDescriptionSettingsAttribute settings:
if (!string.IsNullOrWhiteSpace(settings.GroupName)) groupName = settings.GroupName;
break;
case DisplayNameAttribute displayName:
if (!string.IsNullOrWhiteSpace(displayName.DisplayName)) displayText = displayName.DisplayName;
break;
@ -567,7 +568,7 @@ public class SysAuthService : IDynamicApiController, ITransient
.InnerJoin<SysRoleMenu>((u, a) => u.Id == a.MenuId)
.Where((u, a) => u.Status == StatusEnum.Enable && u.Type == MenuTypeEnum.Btn)
.Where((u, a) => roleIds.Contains(a.RoleId) && SqlFunc.Subqueryable<SysRoleApi>()
.Where(z => roleIds.Contains(z.RoleId) && u.Permission == z.Route).NotAny())
.Where(z => roleIds.Contains(z.RoleId) && u.Permission == z.Route).NotAny())
.Select(u => u.Permission)
.Distinct()
.ToList();