Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
011562ae73 | ||
![]() |
71c4e36933 | ||
![]() |
6261982f6c | ||
![]() |
4ac01e0ed0 | ||
![]() |
2dfe07f13e | ||
![]() |
7f4e4017ce | ||
![]() |
635970f37b | ||
![]() |
106e740220 | ||
![]() |
3e6420ba6f | ||
![]() |
79be8010d5 | ||
![]() |
0b6e679f3b | ||
![]() |
97c43ad2b9 | ||
![]() |
cbf978745c | ||
![]() |
63dceada90 | ||
![]() |
366aade8b4 | ||
![]() |
aeb505e3d9 | ||
![]() |
f9482e4773 |
@@ -3,18 +3,17 @@
|
||||
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<TargetFrameworks>net6.0;net8.0;</TargetFrameworks>
|
||||
<Version>4.0.0.9</Version>
|
||||
<Version>4.0.0.10</Version>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Authors>Diego</Authors>
|
||||
<Product>ThingsGateway</Product>
|
||||
<Copyright>© 2023-present Diego</Copyright>
|
||||
<RepositoryUrl>https://gitee.com/diego2098/ThingsGateway</RepositoryUrl>
|
||||
<SignAssembly>True</SignAssembly>
|
||||
<SignAssembly>False</SignAssembly>
|
||||
<DelaySign>False</DelaySign>
|
||||
<SatelliteResourceLanguages>zh-Hans</SatelliteResourceLanguages>
|
||||
<GenerateDocumentationFile>False</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
|
||||
</Project>
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -26,6 +28,7 @@ namespace ThingsGateway.Admin.ApiController;
|
||||
public class AuthController : IDynamicApiController
|
||||
{
|
||||
private readonly IAuthService _authService;
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="AuthController"/>
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -24,6 +26,7 @@ public class FileController : IDynamicApiController
|
||||
{
|
||||
private readonly IOperateLogService _operateLogService;
|
||||
private readonly IVisitLogService _visitLogService;
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="FileController"/>
|
||||
/// </summary>
|
||||
@@ -50,6 +53,7 @@ public class FileController : IDynamicApiController
|
||||
};
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下载访问日志
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -28,6 +30,7 @@ namespace ThingsGateway.Admin.ApiController;
|
||||
public class OpenApiAuthController : IDynamicApiController
|
||||
{
|
||||
private readonly IOpenApiAuthService _authService;
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="OpenApiAuthController"/>
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -28,6 +30,7 @@ namespace ThingsGateway.Admin.ApiController;
|
||||
public class SwaggerController : IDynamicApiController, IScoped
|
||||
{
|
||||
private readonly IConfigService _configService;
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="SwaggerController"/>
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
global using Furion.DynamicApiController;
|
||||
@@ -16,4 +18,4 @@ global using System;
|
||||
global using System.Threading.Tasks;
|
||||
|
||||
global using ThingsGateway.Admin.Application;
|
||||
global using ThingsGateway.Foundation.Core;
|
||||
global using ThingsGateway.Foundation.Core;
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
@@ -28,14 +30,17 @@ public class OperDescAttribute : Attribute
|
||||
Description = description;
|
||||
Catcategory = catcategory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分类
|
||||
/// </summary>
|
||||
public string Catcategory { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 说明
|
||||
/// </summary>
|
||||
public string Description { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 记录参数,默认true
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.Reflection;
|
||||
@@ -167,7 +169,6 @@ public class OperDispatchProxy : AspectDispatchProxy, IDispatchProxy
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void WriteOperLog(MethodInfo method, object[] args, OperDescAttribute desc, object result, Exception exception)
|
||||
{
|
||||
//写入操作日志
|
||||
@@ -216,9 +217,5 @@ public class OperDispatchProxy : AspectDispatchProxy, IDispatchProxy
|
||||
log.ExeMessage = exception.Source + ":" + exception.Message + Environment.NewLine + exception.StackTrace;
|
||||
}
|
||||
DbContext.Db.CopyNew().InsertableWithAttr(log).ExecuteCommand();//入库
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
@@ -17,7 +19,6 @@ namespace ThingsGateway.Admin.Application;
|
||||
/// </summary>
|
||||
public class CacheConst
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 登录验证码缓存Key
|
||||
/// </summary>
|
||||
@@ -28,7 +29,6 @@ public class CacheConst
|
||||
/// </summary>
|
||||
public const string SYS_CONFIGCATEGORY = "SYS_CONFIGCATEGORY";
|
||||
|
||||
|
||||
#region OpenApi
|
||||
|
||||
/// <summary>
|
||||
@@ -51,7 +51,6 @@ public class CacheConst
|
||||
/// </summary>
|
||||
public const string CACHE_USERVERIFICAT = "CACHE_USERVERIFICAT";
|
||||
|
||||
|
||||
#endregion OpenApi
|
||||
|
||||
/// <summary>
|
||||
@@ -78,6 +77,4 @@ public class CacheConst
|
||||
/// 角色表缓存Key
|
||||
/// </summary>
|
||||
public const string CACHE_SYSROLE = "CACHE_SYSROLE";
|
||||
|
||||
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
@@ -17,19 +19,16 @@ namespace ThingsGateway.Admin.Application;
|
||||
/// </summary>
|
||||
public static class CateGoryConst
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// ThingsGateway.Admin
|
||||
/// </summary>
|
||||
public const string ThingsGatewayAdmin = "ThingsGateway.Admin";
|
||||
|
||||
/// <summary>
|
||||
/// ThingsGateway.OpenApi
|
||||
/// </summary>
|
||||
public const string ThingsGatewayOpenApi = "ThingsGateway.OpenApi";
|
||||
|
||||
|
||||
|
||||
|
||||
#region 关系表
|
||||
|
||||
/// <summary>
|
||||
@@ -56,6 +55,6 @@ public static class CateGoryConst
|
||||
/// 用户有哪些角色
|
||||
/// </summary>
|
||||
public const string Relation_SYS_USER_HAS_ROLE = "SYS_USER_HAS_ROLE";
|
||||
#endregion 关系表
|
||||
|
||||
#endregion 关系表
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
@@ -27,10 +29,8 @@ public static class ConfigConst
|
||||
/// </summary>
|
||||
public const string SYS_CONFIGOTHER = "SYS_CONFIGOTHER";
|
||||
|
||||
|
||||
#region config
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 版权标识
|
||||
/// </summary>
|
||||
@@ -40,6 +40,7 @@ public static class ConfigConst
|
||||
/// 版权跳转url
|
||||
/// </summary>
|
||||
public const string CONFIG_COPYRIGHT_URL = "CONFIG_COPYRIGHT_URL";
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用PageTab
|
||||
/// </summary>
|
||||
@@ -91,6 +92,4 @@ public static class ConfigConst
|
||||
public const string CONFIG_SWAGGERLOGIN_OPEN = "CONFIG_SWAGGERLOGIN_OPEN";
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
@@ -41,7 +43,4 @@ public class EventSubscriberConst
|
||||
/// OpenApi登出
|
||||
/// </summary>
|
||||
public const string LogoutOpenApi = "OpenApi退出";
|
||||
|
||||
|
||||
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
@@ -29,7 +31,6 @@ public class LogConst
|
||||
/// </summary>
|
||||
public const string LOG_LOGOUT = "LOGOUT";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 第三方登录
|
||||
/// </summary>
|
||||
@@ -60,10 +61,10 @@ public class LogConst
|
||||
/// </summary>
|
||||
public const string LOG_SUCCESS = "SUCCESS";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 操作失败
|
||||
/// </summary>
|
||||
public const string LOG_FAIL = "FAIL";
|
||||
|
||||
#endregion 日志表
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Core;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
@@ -40,5 +42,4 @@ public class RoleConst
|
||||
public const string Relation_SYS_USER_HAS_ROLE = "SYS_USER_HAS_ROLE";
|
||||
|
||||
#endregion 关系表
|
||||
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
global using Furion;
|
||||
@@ -21,4 +23,4 @@ global using System.Threading.Tasks;
|
||||
|
||||
global using ThingsGateway.Admin.Core;
|
||||
global using ThingsGateway.Core;
|
||||
global using ThingsGateway.Foundation.Core;
|
||||
global using ThingsGateway.Foundation.Core;
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.Schedule;
|
||||
@@ -36,7 +38,6 @@ public class JobPersistence : IJobPersistence
|
||||
/// <inheritdoc/>
|
||||
public void OnChanged(PersistenceContext context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -52,7 +53,6 @@ public class JobPersistence : IJobPersistence
|
||||
/// <inheritdoc/>
|
||||
public void OnTriggerChanged(PersistenceTriggerContext context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.Schedule;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -31,6 +33,7 @@ public class OpenApiAuthEventSubscriber : IEventSubscriber, ISingleton
|
||||
LoginOpenApiEvent loginEvent = (LoginOpenApiEvent)context.Source.Payload;//获取参数
|
||||
OpenApiUser openApiUser = loginEvent.OpenApiUser;
|
||||
var db = DbContext.Db.CopyNew();
|
||||
|
||||
#region 重新赋值属性,设置本次登录信息为最新的信息
|
||||
|
||||
db.Tracking(openApiUser);//创建跟踪,只更新修改字段
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -25,6 +27,7 @@ public interface IOpenApiAuthService : ITransient
|
||||
/// <param name="input">登录参数</param>
|
||||
/// <returns>Token信息</returns>
|
||||
Task<LoginOpenApiOutput> LoginOpenApiAsync(LoginOpenApiInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 登出
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DataEncryption;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using System.ComponentModel;
|
||||
@@ -25,6 +27,7 @@ public class OpenApiSessionPageInput : BasePageInput
|
||||
/// </summary>
|
||||
[Description("账号")]
|
||||
public string Account { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新登录IP
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using System.ComponentModel;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -22,19 +24,14 @@ namespace ThingsGateway.Admin.Application;
|
||||
[Injection(Proxy = typeof(OperDispatchProxy))]
|
||||
public class OpenApiSessionService : DbRepository<OpenApiUser>, IOpenApiSessionService
|
||||
{
|
||||
|
||||
private readonly IVerificatService _verificatService;
|
||||
|
||||
|
||||
|
||||
/// <inheritdoc cref="IOpenApiSessionService"/>
|
||||
public OpenApiSessionService(IVerificatService verificatService)
|
||||
{
|
||||
_verificatService = verificatService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <inheritdoc/>
|
||||
[OperDesc("强退OPENAPI会话")]
|
||||
public async Task ExitSessionAsync(long input)
|
||||
@@ -91,7 +88,6 @@ public class OpenApiSessionService : DbRepository<OpenApiUser>, IOpenApiSessionS
|
||||
{
|
||||
it.VerificatSignList = new();
|
||||
}
|
||||
|
||||
});
|
||||
for (int i = input.SortField.Count - 1; i >= 0; i--)
|
||||
{
|
||||
@@ -102,5 +98,4 @@ public class OpenApiSessionService : DbRepository<OpenApiUser>, IOpenApiSessionS
|
||||
pageInfo.Records = pageInfo.Records.OrderByDescending(it => it.VerificatCount);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using SqlSugar;
|
||||
@@ -33,14 +35,17 @@ public class OpenApiPermissionTreeSelector
|
||||
/// </summary>
|
||||
[Description("Api路径")]
|
||||
public string ApiRoute { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子节点
|
||||
/// </summary>
|
||||
public List<OpenApiPermissionTreeSelector> Children { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// ID
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父ID
|
||||
/// </summary>
|
||||
@@ -68,7 +73,6 @@ public class OpenApiPermissionTreeSelector
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -81,6 +85,7 @@ public class OpenApiUserAddInput : OpenApiUser
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "账号不能为空"), MinLength(3, ErrorMessage = "账号不能少于4个字符")]
|
||||
public override string Account { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
@@ -91,8 +96,6 @@ public class OpenApiUserAddInput : OpenApiUser
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
public override bool UserEnable { get; set; } = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -111,6 +114,7 @@ public class OpenApiUserEditInput : OpenApiUser
|
||||
/// </summary>
|
||||
[MinValue(1, ErrorMessage = "Id不能为空")]
|
||||
public override long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -53,7 +55,6 @@ public interface IOpenApiUserService : ITransient
|
||||
/// <returns></returns>
|
||||
Task EditAsync(OpenApiUserEditInput input);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 启用用户
|
||||
/// </summary>
|
||||
@@ -74,6 +75,7 @@ public interface IOpenApiUserService : ITransient
|
||||
/// <param name="account">用户名</param>
|
||||
/// <returns>用户信息</returns>
|
||||
Task<OpenApiUser> GetUserByAccountAsync(string account);
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID获取用户信息
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DataEncryption;
|
||||
@@ -58,7 +60,6 @@ public class OpenApiUserService : DbRepository<OpenApiUser>, IOpenApiUserService
|
||||
[OperDesc("删除用户")]
|
||||
public async Task DeleteAsync(params long[] ids)
|
||||
{
|
||||
|
||||
//获取所有ID
|
||||
if (ids.Length > 0)
|
||||
{
|
||||
@@ -75,7 +76,6 @@ public class OpenApiUserService : DbRepository<OpenApiUser>, IOpenApiUserService
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public void DeleteUserFromCache(params long[] ids)
|
||||
{
|
||||
@@ -140,7 +140,6 @@ public class OpenApiUserService : DbRepository<OpenApiUser>, IOpenApiUserService
|
||||
//编辑操作可能会修改用户密码等信息,认证时需要实时获取用户并验证
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc/>
|
||||
[OperDesc("启用用户")]
|
||||
public async Task EnableUserAsync(long input)
|
||||
@@ -249,7 +248,6 @@ public class OpenApiUserService : DbRepository<OpenApiUser>, IOpenApiUserService
|
||||
query = query.OrderBy(it => it.SortCode);//排序
|
||||
query = query.OrderBy(u => u.Id);//排序
|
||||
|
||||
|
||||
var pageInfo = await query.ToPagedListAsync(input.Current, input.Size);//分页
|
||||
return pageInfo;
|
||||
}
|
||||
|
@@ -559,6 +559,6 @@
|
||||
"UpdateUser": "superAdmin",
|
||||
"UpdateUserId": "212725263002001"
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.InstantMessaging;
|
||||
@@ -34,12 +36,14 @@ public class SysHub : Hub<ISysHub>
|
||||
|
||||
private readonly ILogger<ISysHub> _logger;
|
||||
private readonly IServiceScope _serviceScope;
|
||||
|
||||
/// <inheritdoc cref="ISysHub"/>
|
||||
public SysHub(IServiceScopeFactory scopeFactory, ILogger<ISysHub> logger)
|
||||
{
|
||||
_serviceScope = scopeFactory.CreateScope();
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 连接
|
||||
/// </summary>
|
||||
@@ -53,6 +57,7 @@ public class SysHub : Hub<ISysHub>
|
||||
await UpdateVerificatAsync(userIdentifier, verificat: VerificatId);//更新cache
|
||||
await base.OnConnectedAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 断开连接
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Microsoft.AspNetCore.Http.Connections.Features;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@@ -25,7 +27,6 @@ public class Startup : AppStartup
|
||||
/// </summary>
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
|
||||
// 任务调度
|
||||
services.AddSchedule(options =>
|
||||
{
|
||||
@@ -34,6 +35,5 @@ public class Startup : AppStartup
|
||||
|
||||
//事件总线
|
||||
services.AddEventBus();
|
||||
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -23,6 +25,7 @@ namespace ThingsGateway.Admin.Application;
|
||||
public class UserEventSubscriber : IEventSubscriber, ISingleton
|
||||
{
|
||||
private readonly IServiceProvider _services;
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc cref="UserEventSubscriber"/>
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DataEncryption;
|
||||
@@ -36,6 +38,7 @@ public class AuthService : IAuthService
|
||||
private readonly IServiceScope _serviceScope;
|
||||
private readonly ISysUserService _userService;
|
||||
private readonly IVerificatService _verificatService;
|
||||
|
||||
/// <inheritdoc cref="IAuthService"/>
|
||||
public AuthService(
|
||||
IEventPublisher eventPublisher,
|
||||
@@ -175,7 +178,6 @@ public class AuthService : IAuthService
|
||||
return new LoginOutput { VerificatId = sessionid, Account = sysUser.Account };
|
||||
}
|
||||
|
||||
|
||||
private async Task RemoveVerificatAsync(LoginEvent loginEvent)
|
||||
{
|
||||
//获取verificat列表
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using System.ComponentModel;
|
||||
@@ -38,6 +40,7 @@ public class LoginInput : ValidCodeInput
|
||||
[Required(ErrorMessage = "密码不能为空"), MinLength(3, ErrorMessage = "密码不能少于3个字符")]
|
||||
public string Password { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证码输入
|
||||
/// </summary>
|
||||
@@ -53,6 +56,7 @@ public class ValidCodeInput
|
||||
/// </summary>
|
||||
public long ValidCodeReqNo { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 登录设备类型枚举
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
@@ -21,6 +23,7 @@ public class BaseLoginOutput
|
||||
/// 账号
|
||||
/// </summary>
|
||||
public string Account { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 验证ID
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -157,7 +159,5 @@ public class ButtonService : DbRepository<SysResource>, IButtonService
|
||||
sysResource.Category = ResourceCategoryEnum.BUTTON;//设置分类为按钮
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion 方法
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
@@ -37,6 +39,7 @@ public class ButtonAddInput : SysResource
|
||||
[Required(ErrorMessage = "Title不能为空")]
|
||||
public override string Title { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按钮分页
|
||||
/// </summary>
|
||||
@@ -48,6 +51,7 @@ public class ButtonPageInput : BasePageInput
|
||||
[Required(ErrorMessage = "ParentId不能为空")]
|
||||
public long? ParentId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按钮编辑
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -19,8 +21,6 @@ namespace ThingsGateway.Admin.Application;
|
||||
/// </summary>
|
||||
public interface IButtonService : ITransient
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加按钮
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -24,10 +26,12 @@ namespace ThingsGateway.Admin.Application;
|
||||
public class ConfigService : DbRepository<SysConfig>, IConfigService
|
||||
{
|
||||
private readonly IServiceScope _serviceScope;
|
||||
|
||||
public ConfigService(IServiceScopeFactory serviceScopeFactory)
|
||||
{
|
||||
_serviceScope = serviceScopeFactory.CreateScope();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[OperDesc("编辑网关系统配置")]
|
||||
public async Task EditBatchAsync(List<SysConfig> sysConfigs)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using System.ComponentModel;
|
||||
@@ -61,5 +63,4 @@ public class ConfigPageInput : BasePageInput
|
||||
/// </summary>
|
||||
[Description("分类")]
|
||||
public string Category { get; set; }
|
||||
}
|
||||
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -25,6 +27,7 @@ public interface IConfigService : ITransient
|
||||
/// <param name="configs">配置列表</param>
|
||||
/// <returns></returns>
|
||||
Task EditBatchAsync(List<SysConfig> configs);
|
||||
|
||||
/// <summary>
|
||||
/// 新增自定义配置
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.FriendlyException;
|
||||
@@ -21,18 +23,13 @@ namespace ThingsGateway.Admin.Application;
|
||||
/// </summary>
|
||||
public class FileService : IFileService
|
||||
{
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void ImportVerification(IBrowserFile file, int maxSzie = 300, string[] allowTypes = null)
|
||||
{
|
||||
|
||||
if (file == null) throw Oops.Bah("文件不能为空");
|
||||
if (file.Size > maxSzie * 1024 * 1024) throw Oops.Bah($"文件大小不允许超过{maxSzie}M");
|
||||
var fileSuffix = Path.GetExtension(file.Name).ToLower().Split(".")[1]; // 文件后缀
|
||||
string[] allowTypeS = allowTypes ?? new string[] { "xlsx" };//允许上传的文件类型
|
||||
if (!allowTypeS.Contains(fileSuffix)) throw Oops.Bah(errorMessage: "文件格式错误");
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -21,7 +23,6 @@ namespace ThingsGateway.Admin.Application;
|
||||
/// </summary>
|
||||
public interface IFileService : ITransient
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 验证上传文件
|
||||
/// </summary>
|
||||
@@ -29,7 +30,4 @@ public interface IFileService : ITransient
|
||||
/// <param name="maxSzie">最大体积(M)</param>
|
||||
/// <param name="allowTypes">允许上传类型</param>
|
||||
void ImportVerification(IBrowserFile file, int maxSzie = 30, string[] allowTypes = null);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -28,6 +30,7 @@ public class MenuService : DbRepository<SysResource>, IMenuService
|
||||
private readonly IRelationService _relationService;
|
||||
private readonly IResourceService _resourceService;
|
||||
private readonly IRoleService _roleService;
|
||||
|
||||
/// <inheritdoc cref="IMenuService"/>
|
||||
public MenuService(IResourceService resourceService, IRelationService relationService, IRoleService roleService)
|
||||
{
|
||||
@@ -47,7 +50,6 @@ public class MenuService : DbRepository<SysResource>, IMenuService
|
||||
_resourceService.RefreshCache(ResourceCategoryEnum.MENU);//刷新菜单缓存
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
[OperDesc("删除菜单")]
|
||||
public async Task DeleteAsync(params long[] input)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
@@ -21,10 +23,12 @@ namespace ThingsGateway.Admin.Application;
|
||||
public class NoticeService : INoticeService
|
||||
{
|
||||
private readonly IServiceScope _serviceScope;
|
||||
|
||||
public NoticeService(IServiceScopeFactory serviceScopeFactory)
|
||||
{
|
||||
_serviceScope = serviceScopeFactory.CreateScope();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task LogoutAsync(long userId, List<VerificatInfo> verificatInfos, string message)
|
||||
{
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
@@ -18,10 +20,10 @@ namespace ThingsGateway.Admin.Application;
|
||||
public class OperateLogPageInput : VisitLogPageInput
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 操作日志分页输入
|
||||
/// </summary>
|
||||
public class OperateLogInput : VisitLogInput
|
||||
{
|
||||
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -25,12 +27,14 @@ public interface IOperateLogService : ITransient
|
||||
/// <param name="category">分类名称</param>
|
||||
/// <returns></returns>
|
||||
Task DeleteAsync(params string[] category);
|
||||
|
||||
/// <summary>
|
||||
/// 导出后台日志
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task<MemoryStream> ExportFileAsync(List<SysOperateLog> input = null);
|
||||
|
||||
/// <summary>
|
||||
/// 导出后台日志
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -32,6 +34,7 @@ public class OperateLogService : DbRepository<SysOperateLog>, IOperateLogService
|
||||
{
|
||||
await AsDeleteable().Where(it => category.Contains(it.Category)).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[OperDesc("导出操作日志", IsRecordPar = false)]
|
||||
public async Task<MemoryStream> ExportFileAsync(List<SysOperateLog> input = null)
|
||||
@@ -44,6 +47,7 @@ public class OperateLogService : DbRepository<SysOperateLog>, IOperateLogService
|
||||
foreach (var devData in input)
|
||||
{
|
||||
#region sheet
|
||||
|
||||
//变量页
|
||||
var data = devData.GetType().GetProperties();
|
||||
Dictionary<string, object> devExport = new();
|
||||
@@ -76,6 +80,7 @@ public class OperateLogService : DbRepository<SysOperateLog>, IOperateLogService
|
||||
var data = await query.ToListAsync();
|
||||
return await ExportFileAsync(data);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<ISqlSugarPagedList<SysOperateLog>> PageAsync(OperateLogPageInput input)
|
||||
{
|
||||
@@ -94,7 +99,6 @@ public class OperateLogService : DbRepository<SysOperateLog>, IOperateLogService
|
||||
.WhereIF(!string.IsNullOrEmpty(input.ExeStatus), it => it.ExeStatus == input.ExeStatus)//根据结果查询
|
||||
.WhereIF(!string.IsNullOrEmpty(input.SearchKey), it => it.Name.Contains(input.SearchKey) || it.OpIp.Contains(input.SearchKey));//根据关键字查询
|
||||
|
||||
|
||||
for (int i = input.SortField.Count - 1; i >= 0; i--)
|
||||
{
|
||||
query = query.OrderByIF(!string.IsNullOrEmpty(input.SortField[i]), $"{input.SortField[i]} {(input.SortDesc[i] ? "desc" : "asc")}");
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.FriendlyException;
|
||||
@@ -20,10 +22,12 @@ namespace ThingsGateway.Admin.Application;
|
||||
public class RelationService : DbRepository<SysRelation>, IRelationService
|
||||
{
|
||||
private readonly IServiceScope _serviceScope;
|
||||
|
||||
public RelationService(IServiceScopeFactory serviceScopeFactory)
|
||||
{
|
||||
_serviceScope = serviceScopeFactory.CreateScope();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task<List<SysRelation>> GetRelationByCategoryAsync(string category)
|
||||
{
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,11 +9,11 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 角色按钮资源
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -24,6 +26,7 @@ public interface IResourceService : ITransient
|
||||
/// </summary>
|
||||
/// <returns>所有的菜单和模块以及单页面列表</returns>
|
||||
Task<List<SysResource>> GetaMenuAndSpaListAsync();
|
||||
|
||||
/// <summary>
|
||||
/// 获取子资源
|
||||
/// </summary>
|
||||
@@ -54,6 +57,7 @@ public interface IResourceService : ITransient
|
||||
/// <param name="categorys">资源分类列表</param>
|
||||
/// <returns></returns>
|
||||
Task<List<SysResource>> GetListByCategorysAsync(List<ResourceCategoryEnum> categorys = null);
|
||||
|
||||
/// <summary>
|
||||
/// 获取资源所有下级
|
||||
/// </summary>
|
||||
@@ -89,10 +93,10 @@ public interface IResourceService : ITransient
|
||||
/// <returns>菜单形结构</returns>
|
||||
/// <inheritdoc/>
|
||||
List<SysResource> ResourceListToTree(List<SysResource> resourceList, long parentId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// 多个树转列表
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
List<SysResource> ResourceTreeToList(List<SysResource> data);
|
||||
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Mapster;
|
||||
@@ -16,15 +18,16 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
||||
|
||||
/// <inheritdoc cref="IResourceService"/>
|
||||
public class ResourceService : DbRepository<SysResource>, IResourceService
|
||||
{
|
||||
private readonly IServiceScope _serviceScope;
|
||||
|
||||
public ResourceService(IServiceScopeFactory serviceScopeFactory)
|
||||
{
|
||||
_serviceScope = serviceScopeFactory.CreateScope();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task<List<SysResource>> GetaMenuAndSpaListAsync()
|
||||
{
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -67,6 +69,7 @@ public interface IRoleService : ITransient
|
||||
/// <param name="input">授权信息</param>
|
||||
/// <returns></returns>
|
||||
Task GrantUserAsync(GrantUserInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 角色拥有资源
|
||||
/// </summary>
|
||||
@@ -98,6 +101,7 @@ public interface IRoleService : ITransient
|
||||
/// 角色刷新资源
|
||||
/// </summary>
|
||||
Task RefreshResourceAsync(long? menuId = null);
|
||||
|
||||
/// <summary>
|
||||
/// 角色选择器
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -82,7 +84,6 @@ namespace ThingsGateway.Admin.Application
|
||||
await Context.Deleteable<SysRelation>().Where(it => ids.Contains(it.ObjectId) && delRelations.Contains(it.Category)).ExecuteCommandAsync();
|
||||
//删除关系表角色与用户关系
|
||||
await Context.Deleteable<SysRelation>().Where(it => targetIds.Contains(it.TargetId) && it.Category == CateGoryConst.Relation_SYS_USER_HAS_ROLE).ExecuteCommandAsync();
|
||||
|
||||
});
|
||||
if (result.IsSuccess)//如果成功了
|
||||
{
|
||||
@@ -288,7 +289,6 @@ namespace ThingsGateway.Admin.Application
|
||||
//删除老的
|
||||
await Context.Deleteable<SysRelation>().Where(it => it.TargetId == input.Id.ToString() && it.Category == CateGoryConst.Relation_SYS_USER_HAS_ROLE).ExecuteCommandAsync();
|
||||
await Context.Insertable(sysRelations).ExecuteCommandAsync();//添加新的
|
||||
|
||||
});
|
||||
if (result.IsSuccess)//如果成功了
|
||||
{
|
||||
@@ -361,8 +361,6 @@ namespace ThingsGateway.Admin.Application
|
||||
await GrantResourceAsync(new GrantResourceInput() { Id = item.Id, GrantInfoList = r1.GrantInfoList });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using System.ComponentModel;
|
||||
@@ -25,6 +27,7 @@ public class SessionPageInput : BasePageInput
|
||||
/// </summary>
|
||||
[Description("账号")]
|
||||
public string Account { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新登录IP
|
||||
/// </summary>
|
||||
@@ -48,6 +51,7 @@ public class ExitVerificatInput : BaseIdInput
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "VerificatIds不能为空")]
|
||||
public List<long> VerificatIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using System.ComponentModel;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -84,14 +86,12 @@ public class SessionService : DbRepository<SysUser>, ISessionService
|
||||
{
|
||||
it.VerificatSignList = new();
|
||||
}
|
||||
|
||||
});
|
||||
for (int i = input.SortField.Count - 1; i >= 0; i--)
|
||||
{
|
||||
query = query.OrderByIF(!string.IsNullOrEmpty(input.SortField[i]), $"{input.SortField[i]} {(input.SortDesc[i] ? "desc" : "asc")}");
|
||||
}
|
||||
|
||||
|
||||
var pageInfo = await query.ToPagedListAsync(input.Current, input.Size);//分页
|
||||
return pageInfo;
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using SqlSugar;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
@@ -31,5 +33,4 @@ public class UserSelectorOutput
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -39,7 +41,6 @@ public interface ISysUserService : ITransient
|
||||
/// <param name="ids">用户ID列表</param>
|
||||
void DeleteUserFromCache(params long[] ids);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 禁用用户
|
||||
/// </summary>
|
||||
@@ -81,6 +82,7 @@ public interface ISysUserService : ITransient
|
||||
/// <param name="account">用户名</param>
|
||||
/// <returns>用户信息</returns>
|
||||
Task<SysUser> GetUserByAccountAsync(string account);
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID获取用户信息
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DataEncryption;
|
||||
@@ -34,6 +36,7 @@ public class SysUserService : DbRepository<SysUser>, ISysUserService
|
||||
private readonly IRoleService _roleService;
|
||||
private readonly IVerificatService _verificatService;
|
||||
private readonly IServiceScope _serviceScope;
|
||||
|
||||
/// <inheritdoc cref="ISysUserService"/>
|
||||
public SysUserService(
|
||||
IRelationService relationService,
|
||||
@@ -383,7 +386,6 @@ public class SysUserService : DbRepository<SysUser>, ISysUserService
|
||||
if (!sysUser.Phone.MatchPhoneNumber())//验证手机格式
|
||||
throw Oops.Bah($"手机号码:{sysUser.Phone} 格式错误");
|
||||
sysUser.Phone = DESCEncryption.Encrypt(sysUser.Phone, DESCKeyConst.DESCKey);
|
||||
|
||||
}
|
||||
//如果邮箱不是空
|
||||
if (!string.IsNullOrEmpty(sysUser.Email))
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using System.ComponentModel;
|
||||
@@ -26,6 +28,7 @@ public class UpdateInfoInput : SysUser
|
||||
[MinValue(1, ErrorMessage = "Id不能为空")]
|
||||
public override long Id { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改密码
|
||||
/// </summary>
|
||||
@@ -37,12 +40,14 @@ public class PasswordInfoInput : BaseIdInput, IValidatableObject
|
||||
[Description("旧密码")]
|
||||
[Required(ErrorMessage = "不能为空")]
|
||||
public string OldPassword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 新密码
|
||||
/// </summary>
|
||||
[Description("新密码")]
|
||||
[Required(ErrorMessage = "不能为空")]
|
||||
public string NewPassword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 确认密码
|
||||
/// </summary>
|
||||
@@ -56,4 +61,4 @@ public class PasswordInfoInput : BaseIdInput, IValidatableObject
|
||||
if (NewPassword != ConfirmPassword)
|
||||
yield return new ValidationResult("两次密码不一致", new[] { nameof(ConfirmPassword) });
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -25,6 +27,7 @@ public interface IUserCenterService : ITransient
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task EditPasswordAsync(PasswordInfoInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 获取个人主页
|
||||
/// </summary>
|
||||
@@ -58,6 +61,7 @@ public interface IUserCenterService : ITransient
|
||||
/// <param name="input">信息参数</param>
|
||||
/// <returns></returns>
|
||||
Task UpdateUserInfoAsync(UpdateInfoInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 编辑个人工作台
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DataEncryption;
|
||||
@@ -20,7 +22,6 @@ using ThingsGateway.Foundation.Extension.String;
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
||||
|
||||
/// <inheritdoc cref="IUserCenterService"/>
|
||||
[Injection(Proxy = typeof(OperDispatchProxy))]
|
||||
public class UserCenterService : DbRepository<SysUser>, IUserCenterService
|
||||
@@ -86,6 +87,7 @@ public class UserCenterService : DbRepository<SysUser>, IUserCenterService
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task UpdateUserDefaultRazorAsync(long userId, long defaultRazor)
|
||||
{
|
||||
@@ -148,6 +150,7 @@ public class UserCenterService : DbRepository<SysUser>, IUserCenterService
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[OperDesc("用户更新个人信息")]
|
||||
public async Task UpdateUserInfoAsync(UpdateInfoInput input)
|
||||
@@ -186,8 +189,8 @@ public class UserCenterService : DbRepository<SysUser>, IUserCenterService
|
||||
//关系表保存个人工作台
|
||||
await _relationService.SaveRelationAsync(CateGoryConst.Relation_SYS_USER_WORKBENCH_DATA, UserManager.UserId, null, input.ToJsonString(), true);
|
||||
}
|
||||
#region 方法
|
||||
|
||||
#region 方法
|
||||
|
||||
/// <summary>
|
||||
/// 获取父菜单集合,已过滤掉同时存在的父节点
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -32,6 +34,7 @@ public interface IVerificatService : ITransient
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<VerificatInfo>> GetVerificatIdAsync(long userId);
|
||||
|
||||
/// <summary>
|
||||
/// 设置验证ID
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@@ -18,10 +20,12 @@ namespace ThingsGateway.Admin.Application;
|
||||
public class VerificatService : DbRepository<SysVerificat>, IVerificatService
|
||||
{
|
||||
private readonly IServiceScope _serviceScope;
|
||||
|
||||
public VerificatService(IServiceScopeFactory serviceScopeFactory)
|
||||
{
|
||||
_serviceScope = serviceScopeFactory.CreateScope();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task<List<VerificatInfo>> GetOpenApiVerificatIdAsync(long userId)
|
||||
{
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using System.ComponentModel;
|
||||
@@ -23,10 +25,12 @@ public class VisitLogPageInput : BasePageInput
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
public DateTime? StartTime { get; set; } = DateTime.UtcNow.AddDays(-1);
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
public DateTime? EndTime { get; set; } = DateTime.UtcNow.AddDays(1);
|
||||
|
||||
/// <summary>
|
||||
/// 账号
|
||||
/// </summary>
|
||||
@@ -55,6 +59,7 @@ public class VisitLogInput
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
public DateTime? StartTime { get; set; } = DateTime.UtcNow.AddDays(-1);
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -26,12 +28,14 @@ public interface IVisitLogService : ITransient
|
||||
/// <param name="category">分类名称</param>
|
||||
/// <returns></returns>
|
||||
Task DeleteAsync(params string[] category);
|
||||
|
||||
/// <summary>
|
||||
/// 导出访问日志
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task<MemoryStream> ExportFileAsync(VisitLogInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 导出访问日志
|
||||
/// </summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
@@ -72,6 +74,7 @@ public class VisitLogService : DbRepository<SysVisitLog>, IVisitLogService
|
||||
foreach (var devData in input)
|
||||
{
|
||||
#region sheet
|
||||
|
||||
//变量页
|
||||
var data = devData.GetType().GetProperties();
|
||||
Dictionary<string, object> devExport = new();
|
||||
@@ -104,5 +107,4 @@ public class VisitLogService : DbRepository<SysVisitLog>, IVisitLogService
|
||||
var data = await query.ToListAsync();
|
||||
return await ExportFileAsync(data);
|
||||
}
|
||||
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -41,7 +43,6 @@ public class SeedDataUtil
|
||||
//将json字符串转为实体,这里extjson可以正常转换为字符串
|
||||
var seedDataRecord = Newtonsoft.Json.JsonConvert.DeserializeObject<SeedDataRecords<T>>(dataString);
|
||||
|
||||
|
||||
//遍历seedDataRecord
|
||||
for (int i = 0; i < seedDataRecord.Records.Count; i++)
|
||||
{
|
||||
@@ -91,7 +92,6 @@ public class SeedDataUtil
|
||||
|
||||
return seedData;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,9 +9,11 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Blazor;
|
||||
|
||||
/// <summary>
|
||||
/// NavItemExtensions
|
||||
/// </summary>
|
||||
@@ -69,6 +72,4 @@ public static class NavItemExtensions
|
||||
Href = menu.Component,
|
||||
Target = menu.TargetType == TargetTypeEnum.SELF ? "_self" : "_blank",
|
||||
};
|
||||
|
||||
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
global using BlazorComponent;
|
||||
@@ -25,4 +27,4 @@ global using ThingsGateway.Admin.Application;
|
||||
global using ThingsGateway.Admin.Core;
|
||||
global using ThingsGateway.Components;
|
||||
global using ThingsGateway.Core;
|
||||
global using ThingsGateway.Foundation.Core;
|
||||
global using ThingsGateway.Foundation.Core;
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@@ -23,9 +25,12 @@ namespace ThingsGateway.Admin.Blazor
|
||||
{
|
||||
_serviceScope = _serviceScopeFactory.CreateScope();
|
||||
}
|
||||
|
||||
[Inject]
|
||||
private IServiceScopeFactory _serviceScopeFactory { get; set; }
|
||||
|
||||
protected IServiceScope _serviceScope { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
@@ -51,8 +56,6 @@ namespace ThingsGateway.Admin.Blazor
|
||||
}
|
||||
|
||||
await base.OnAfterRenderAsync(firstRender);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Masa.Blazor;
|
||||
@@ -25,6 +27,7 @@ public partial class Config
|
||||
private IAppDataTable _datatable;
|
||||
private List<SysConfig> _sysConfig = new();
|
||||
private StringNumber _tabNumber;
|
||||
|
||||
[CascadingParameter]
|
||||
private MainLayout _mainLayout { get; set; }
|
||||
|
||||
@@ -37,6 +40,7 @@ public partial class Config
|
||||
_sysConfig = await _serviceScope.ServiceProvider.GetService<IConfigService>().GetListByCategoryAsync(ConfigConst.SYS_CONFIGBASEDEFAULT);
|
||||
await base.OnParametersSetAsync();
|
||||
}
|
||||
|
||||
private async Task AddCallAsync(ConfigAddInput input)
|
||||
{
|
||||
await _serviceScope.ServiceProvider.GetService<IConfigService>().AddAsync(input);
|
||||
@@ -46,6 +50,7 @@ public partial class Config
|
||||
{
|
||||
await _serviceScope.ServiceProvider.GetService<IConfigService>().DeleteAsync(sysConfigs.Select(a => a.Id).ToArray());
|
||||
}
|
||||
|
||||
private async Task EditCallAsync(ConfigEditInput sysConfigs)
|
||||
{
|
||||
await _serviceScope.ServiceProvider.GetService<IConfigService>().EditAsync(sysConfigs);
|
||||
@@ -57,6 +62,7 @@ public partial class Config
|
||||
await _mainLayout.StateHasChangedAsync();
|
||||
await PopupService.EnqueueSnackbarAsync("成功", AlertTypes.Success);
|
||||
}
|
||||
|
||||
private async Task<ISqlSugarPagedList<SysConfig>> QueryCallAsync(ConfigPageInput input)
|
||||
{
|
||||
return await _serviceScope.ServiceProvider.GetService<IConfigService>().PageAsync(input);
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#region copyright
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
@@ -8,6 +9,7 @@
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endregion
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@@ -15,6 +17,7 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using SqlSugar;
|
||||
|
||||
namespace ThingsGateway.Admin.Blazor;
|
||||
|
||||
/// <summary>
|
||||
/// 首页
|
||||
/// </summary>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user