添加项目文件。

This commit is contained in:
2023-03-13 15:00:34 +08:00
parent 42bf06ca3e
commit 1d73df3235
1205 changed files with 185078 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
using JNPF.DependencyInjection;
using JNPF.Systems.Entitys.Dto.Module;
using JNPF.Systems.Entitys.Dto.ModuleButton;
using JNPF.Systems.Entitys.Dto.ModuleColumn;
using JNPF.Systems.Entitys.Dto.ModuleDataAuthorizeScheme;
using JNPF.Systems.Entitys.Dto.ModuleForm;
namespace JNPF.OAuth.Dto;
/// <summary>
/// 当前用户模型输出.
/// </summary>
[SuppressSniffer]
public class CurrentUserModelOutput
{
/// <summary>
/// 菜单权限.
/// </summary>
public List<ModuleOutput> moduleList { get; set; }
/// <summary>
/// 按钮权限.
/// </summary>
public List<ModuleButtonOutput> buttonList { get; set; }
/// <summary>
/// 列表权限.
/// </summary>
public List<ModuleColumnOutput> columnList { get; set; }
/// <summary>
/// 数据权限.
/// </summary>
public List<ModuleDataAuthorizeSchemeOutput> resourceList { get; set; }
/// <summary>
/// 表单权限.
/// </summary>
public List<ModuleFormOutput> formList { get; set; }
}

View File

@@ -0,0 +1,238 @@
using JNPF.Common.Models.User;
using JNPF.Common.Security;
using JNPF.DependencyInjection;
using JNPF.Systems.Entitys.Dto.Module;
namespace JNPF.OAuth.Dto;
/// <summary>
/// 当前客户信息输出.
/// </summary>
[SuppressSniffer]
public class CurrentUserOutput
{
/// <summary>
/// 用户信息.
/// </summary>
public UserInfoModel userInfo { get; set; }
/// <summary>
/// 菜单列表.
/// </summary>
public List<ModuleNodeOutput> menuList { get; set; }
/// <summary>
/// 权限列表.
/// </summary>
public List<PermissionModel> permissionList { get; set; }
/// <summary>
/// 系统配置信息.
/// </summary>
public SysConfigInfo sysConfigInfo { get; set; }
/// <summary>
/// 系统菜单树.
/// </summary>
public List<UserAllMenu> routerList { get; set; }
}
/// <summary>
/// 权限.
/// </summary>
[SuppressSniffer]
public class PermissionModel
{
/// <summary>
/// 模块ID.
/// </summary>
public string modelId { get; set; }
/// <summary>
/// 模块名称.
/// </summary>
public string moduleName { get; set; }
/// <summary>
/// 列.
/// </summary>
public List<FunctionalColumnAuthorizeModel> column { get; set; }
/// <summary>
/// 按钮.
/// </summary>
public List<FunctionalButtonAuthorizeModel> button { get; set; }
/// <summary>
/// 表单.
/// </summary>
public List<FunctionalFormAuthorizeModel> form { get; set; }
/// <summary>
/// 资源.
/// </summary>
public List<FunctionalResourceAuthorizeModel> resource { get; set; }
}
/// <summary>
/// 功能权限基类.
/// </summary>
[SuppressSniffer]
public class FunctionalAuthorizeBase
{
/// <summary>
/// 主键.
/// </summary>
public string id { get; set; }
/// <summary>
/// 名称.
/// </summary>
public string fullName { get; set; }
/// <summary>
/// 编码.
/// </summary>
public string enCode { get; set; }
}
/// <summary>
/// 功能权限列.
/// </summary>
[SuppressSniffer]
public class FunctionalColumnAuthorizeModel : FunctionalAuthorizeBase
{
}
/// <summary>
/// 功能权限按钮.
/// </summary>
[SuppressSniffer]
public class FunctionalButtonAuthorizeModel : FunctionalAuthorizeBase
{
}
/// <summary>
/// 功能权限表单.
/// </summary>
[SuppressSniffer]
public class FunctionalFormAuthorizeModel : FunctionalAuthorizeBase
{
}
/// <summary>
/// 授权模块资源.
/// </summary>
[SuppressSniffer]
public class FunctionalResourceAuthorizeModel : FunctionalAuthorizeBase
{
}
/// <summary>
/// 系统配置信息.
/// </summary>
[SuppressSniffer]
public class SysConfigInfo
{
/// <summary>
/// 系统名称.
/// </summary>
public string sysName { get; set; }
/// <summary>
/// 系统版本.
/// </summary>
public string sysVersion { get; set; }
/// <summary>
/// 登录图标.
/// </summary>
public string loginIcon { get; set; }
/// <summary>
/// 版权信息.
/// </summary>
public string copyright { get; set; }
/// <summary>
/// 公司名称.
/// </summary>
public string companyName { get; set; }
/// <summary>
/// 导航图标.
/// </summary>
public string navigationIcon { get; set; }
/// <summary>
/// logo图标.
/// </summary>
public string logoIcon { get; set; }
/// <summary>
/// App图标.
/// </summary>
public string appIcon { get; set; }
}
/// <summary>
/// 获取登录用户信息返回值.
/// </summary>
public class UserAllMenu
{
/// <summary>
/// 获取节点id.
/// </summary>
/// <returns></returns>
public string id { get; set; }
/// <summary>
/// 获取节点父id.
/// </summary>
/// <returns></returns>
public string parentId { get; set; }
/// <summary>
/// 是否有子级.
/// </summary>
public bool hasChildren { get; set; }
/// <summary>
/// 名称.
/// </summary>
public string fullName { get; set; }
/// <summary>
/// 编码.
/// </summary>
public string enCode { get; set; }
/// <summary>
/// 图标.
/// </summary>
public string icon { get; set; }
/// <summary>
/// 菜单地址.
/// </summary>
public string urlAddress { get; set; }
/// <summary>
/// 链接目标.
/// </summary>
public string linkTarget { get; set; }
/// <summary>
/// 子集.
/// </summary>
public List<UserAllMenu> children { get; set; }
/// <summary>
/// 菜单分类【1-类别、2-页面】.
/// </summary>
public int type { get; set; }
public string propertyJson { get; set; }
public string sortCode { get; set; }
public string systemId { get; set; }
}

View File

@@ -0,0 +1,25 @@
using JNPF.DependencyInjection;
using System.ComponentModel.DataAnnotations;
namespace JNPF.OAuth.Dto;
/// <summary>
/// 锁屏解锁输入参数.
/// </summary>
[SuppressSniffer]
public class LockScreenInput
{
/// <summary>
/// 用户名.
/// </summary>
/// <example>admin</example>
[Required(ErrorMessage = "用户名不能为空")]
public string? account { get; set; }
/// <summary>
/// 密码.
/// </summary>
/// <example>e10adc3949ba59abbe56e057f20f883e</example>
[Required(ErrorMessage = "密码不能为空")]
public string? password { get; set; }
}

View File

@@ -0,0 +1,56 @@
using JNPF.DependencyInjection;
using System.ComponentModel.DataAnnotations;
namespace JNPF.OAuth.Dto;
/// <summary>
/// 登录输入参数.
/// </summary>
[SuppressSniffer]
public class LoginInput
{
/// <summary>
/// 用户名.
/// </summary>
/// <example>13459475357</example>
[Required(ErrorMessage = "用户名不能为空")]
public string? account { get; set; }
/// <summary>
/// 密码.
/// </summary>
/// <example>e10adc3949ba59abbe56e057f20f883e</example>
[Required(ErrorMessage = "密码不能为空")]
public string? password { get; set; }
/// <summary>
/// 验证码.
/// </summary>
public string? code { get; set; }
/// <summary>
/// 验证码时间戳.
/// </summary>
public string? timestamp { get; set; }
/// <summary>
/// 判断是否需要验证码.
/// </summary>
/// <example>password</example>
public string? origin { get; set; }
/// <summary>
/// 租户库信息 第三方登录回调.
/// </summary>
public SqlSugar.ConnectionConfigOptions? socialsOptions { get; set; }
/// <summary>
/// 是否第三方登录回调.
/// </summary>
public bool isSocialsLoginCallBack { get; set; } = false;
/// <summary>
/// 未绑定 成功登录后 自动绑定 缓存 Key.
/// </summary>
public string jnpf_ticket { get; set; }
}

View File

@@ -0,0 +1,56 @@
using JNPF.Common.Enums;
using JNPF.DependencyInjection;
using JNPF.JsonSerialization;
using JNPF.Systems.Entitys.Enum;
using Newtonsoft.Json;
namespace JNPF.OAuth.Model;
/// <summary>
/// 登录时需要的系统配置.
/// </summary>
[SuppressSniffer]
public class SysConfigByOAuthModel
{
/// <summary>
/// 是否开启验证码0不启用1启用.
/// </summary>
[JsonConverter(typeof(BoolJsonConverter))]
public bool enableVerificationCode { get; set; }
/// <summary>
/// 错误策略1账号锁定2延时登录.
/// </summary>
public ErrorStrategy lockType { get; set; }
/// <summary>
/// 错误密码次数.
/// </summary>
public int passwordErrorsNumber { get; set; } = 6;
/// <summary>
/// 延时登录时间(分钟).
/// </summary>
public int lockTime { get; set; } = 10;
/// <summary>
/// 是否开启白名单验证.
/// </summary>
[JsonConverter(typeof(BoolJsonConverter))]
public bool whitelistSwitch { get; set; }
/// <summary>
/// 白名单.
/// </summary>
public string whiteListIp { get; set; }
/// <summary>
/// 超时登出.
/// </summary>
public long tokenTimeout { get; set; }
/// <summary>
/// 单一登录方式1后登录踢出先登录 2同时登录.
/// </summary>
public LoginMethod singleLogin { get; set; }
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(SolutionDir)\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\common\Tnb.Common.Core\Tnb.Common.Core.csproj" />
<ProjectReference Include="..\Tnb.Systems.Interfaces\Tnb.Systems.Interfaces.csproj" />
</ItemGroup>
</Project>