⚡优化功能、类目录
This commit is contained in:
parent
94fa69e8ef
commit
07b4b95732
@ -1,4 +1,5 @@
|
|||||||
using Microsoft.AspNetCore.Hosting;
|
using Infrastructure.Model;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|||||||
@ -2,6 +2,9 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
<NoWarn>8632</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||||
@ -16,6 +19,7 @@
|
|||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||||
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.7" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -1,14 +1,20 @@
|
|||||||
using Microsoft.IdentityModel.Tokens;
|
using Infrastructure.Extensions;
|
||||||
|
using Infrastructure.Model;
|
||||||
|
using Infrastructure.WebExtensins;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IdentityModel.Tokens.Jwt;
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
|
using System.Linq;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using ZR.Model.System.Dto;
|
|
||||||
|
|
||||||
namespace ZR.Admin.WebApi.Framework
|
namespace Infrastructure
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 2020-11-20
|
/// 2023-8-29已从WebApi移至此
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class JwtUtil
|
public class JwtUtil
|
||||||
{
|
{
|
||||||
@ -17,7 +23,7 @@ namespace ZR.Admin.WebApi.Framework
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="httpContext"></param>
|
/// <param name="httpContext"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static LoginUser GetLoginUser(HttpContext httpContext)
|
public static TokenModel GetLoginUser(HttpContext httpContext)
|
||||||
{
|
{
|
||||||
string token = httpContext.GetToken();
|
string token = httpContext.GetToken();
|
||||||
|
|
||||||
@ -53,7 +59,7 @@ namespace ZR.Admin.WebApi.Framework
|
|||||||
IssuedAt = authTime,//token生成时间
|
IssuedAt = authTime,//token生成时间
|
||||||
Expires = expiresAt,
|
Expires = expiresAt,
|
||||||
//NotBefore = authTime,
|
//NotBefore = authTime,
|
||||||
TokenType = "Bearer",
|
TokenType = jwtSettings.TokenType,
|
||||||
//对称秘钥,签名证书
|
//对称秘钥,签名证书
|
||||||
SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature)
|
SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature)
|
||||||
};
|
};
|
||||||
@ -118,18 +124,18 @@ namespace ZR.Admin.WebApi.Framework
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="jwtSecurityToken"></param>
|
/// <param name="jwtSecurityToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static LoginUser? ValidateJwtToken(JwtSecurityToken jwtSecurityToken)
|
public static TokenModel? ValidateJwtToken(JwtSecurityToken jwtSecurityToken)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (jwtSecurityToken == null) return null;
|
if (jwtSecurityToken == null) return null;
|
||||||
IEnumerable<Claim> claims = jwtSecurityToken?.Claims;
|
IEnumerable<Claim> claims = jwtSecurityToken?.Claims;
|
||||||
LoginUser loginUser = null;
|
TokenModel loginUser = null;
|
||||||
|
|
||||||
var userData = claims.FirstOrDefault(x => x.Type == ClaimTypes.UserData)?.Value;
|
var userData = claims.FirstOrDefault(x => x.Type == ClaimTypes.UserData)?.Value;
|
||||||
if (userData != null)
|
if (userData != null)
|
||||||
{
|
{
|
||||||
loginUser = JsonConvert.DeserializeObject<LoginUser>(userData);
|
loginUser = JsonConvert.DeserializeObject<TokenModel>(userData);
|
||||||
loginUser.ExpireTime = jwtSecurityToken.ValidTo;
|
loginUser.ExpireTime = jwtSecurityToken.ValidTo;
|
||||||
}
|
}
|
||||||
return loginUser;
|
return loginUser;
|
||||||
@ -146,7 +152,7 @@ namespace ZR.Admin.WebApi.Framework
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="user"></param>
|
/// <param name="user"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static List<Claim> AddClaims(LoginUser user)
|
public static List<Claim> AddClaims(TokenModel user)
|
||||||
{
|
{
|
||||||
var claims = new List<Claim>()
|
var claims = new List<Claim>()
|
||||||
{
|
{
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Infrastructure
|
namespace Infrastructure.Model
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取配置文件POCO实体类
|
/// 获取配置文件POCO实体类
|
||||||
@ -80,6 +80,14 @@ namespace Infrastructure
|
|||||||
/// token时间(分)
|
/// token时间(分)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Expire { get; set; } = 1440;
|
public int Expire { get; set; } = 1440;
|
||||||
|
/// <summary>
|
||||||
|
/// 刷新token时长
|
||||||
|
/// </summary>
|
||||||
|
public int RefreshTokenTime { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// token类型
|
||||||
|
/// </summary>
|
||||||
|
public string TokenType { get; set; } = "Bearer";
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Gen
|
public class Gen
|
||||||
@ -1,11 +1,10 @@
|
|||||||
using System.Linq;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace ZR.Model.System.Dto
|
namespace Infrastructure.Model
|
||||||
{
|
{
|
||||||
/// <summary>
|
public class TokenModel
|
||||||
/// 登录用户信息存储
|
|
||||||
/// </summary>
|
|
||||||
public class LoginUser
|
|
||||||
{
|
{
|
||||||
public long UserId { get; set; }
|
public long UserId { get; set; }
|
||||||
public long DeptId { get; set; }
|
public long DeptId { get; set; }
|
||||||
@ -26,15 +25,15 @@ namespace ZR.Model.System.Dto
|
|||||||
/// 权限集合
|
/// 权限集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
//public List<string> Permissions { get; set; } = new List<string>();
|
//public List<string> Permissions { get; set; } = new List<string>();
|
||||||
public LoginUser()
|
public TokenModel()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public LoginUser(SysUser user, List<Roles> roles)
|
public TokenModel(TokenModel info, List<Roles> roles)
|
||||||
{
|
{
|
||||||
UserId = user.UserId;
|
UserId = info.UserId;
|
||||||
UserName = user.UserName;
|
UserName = info.UserName;
|
||||||
DeptId = user.DeptId;
|
DeptId = info.DeptId;
|
||||||
Roles = roles;
|
Roles = roles;
|
||||||
RoleIds = roles.Select(f => f.RoleKey).ToList();
|
RoleIds = roles.Select(f => f.RoleKey).ToList();
|
||||||
}
|
}
|
||||||
@ -1,10 +1,7 @@
|
|||||||
using IPTools.Core;
|
using Lazy.Captcha.Core;
|
||||||
using Lazy.Captcha.Core;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using UAParser;
|
|
||||||
using ZR.Admin.WebApi.Filters;
|
using ZR.Admin.WebApi.Filters;
|
||||||
using ZR.Admin.WebApi.Framework;
|
|
||||||
using ZR.Model.System;
|
using ZR.Model.System;
|
||||||
using ZR.Model.System.Dto;
|
using ZR.Model.System.Dto;
|
||||||
using ZR.Service.System;
|
using ZR.Service.System;
|
||||||
@ -86,7 +83,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
|||||||
//权限集合 eg *:*:*,system:user:list
|
//权限集合 eg *:*:*,system:user:list
|
||||||
List<string> permissions = permissionService.GetMenuPermission(user);
|
List<string> permissions = permissionService.GetMenuPermission(user);
|
||||||
|
|
||||||
LoginUser loginUser = new(user, roles.Adapt<List<Roles>>());
|
TokenModel loginUser = new(user.Adapt<TokenModel>(), roles.Adapt<List<Roles>>());
|
||||||
CacheService.SetUserPerms(GlobalConstant.UserPermKEY + user.UserId, permissions);
|
CacheService.SetUserPerms(GlobalConstant.UserPermKEY + user.UserId, permissions);
|
||||||
return SUCCESS(JwtUtil.GenerateJwtToken(JwtUtil.AddClaims(loginUser)));
|
return SUCCESS(JwtUtil.GenerateJwtToken(JwtUtil.AddClaims(loginUser)));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
using Infrastructure.Constant;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.AspNetCore.SignalR;
|
using Microsoft.AspNetCore.SignalR;
|
||||||
using ZR.Admin.WebApi.Filters;
|
using ZR.Admin.WebApi.Filters;
|
||||||
using ZR.Admin.WebApi.Hubs;
|
using ZR.Admin.WebApi.Hubs;
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
using Infrastructure;
|
using SqlSugar;
|
||||||
using SqlSugar.IOC;
|
using SqlSugar.IOC;
|
||||||
using SqlSugar;
|
|
||||||
using ZR.Admin.WebApi.Framework;
|
|
||||||
using ZR.Model.System;
|
using ZR.Model.System;
|
||||||
|
|
||||||
namespace ZR.Admin.WebApi.Extensions
|
namespace ZR.Admin.WebApi.Extensions
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
using Infrastructure;
|
|
||||||
using Infrastructure.Extensions;
|
using Infrastructure.Extensions;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using SqlSugar.IOC;
|
using SqlSugar.IOC;
|
||||||
|
|||||||
@ -14,7 +14,7 @@ namespace Infrastructure
|
|||||||
Console.ForegroundColor = ConsoleColor.Blue;
|
Console.ForegroundColor = ConsoleColor.Blue;
|
||||||
Console.WriteLine("🎉源码地址: https://gitee.com/izory/ZrAdminNetCore");
|
Console.WriteLine("🎉源码地址: https://gitee.com/izory/ZrAdminNetCore");
|
||||||
Console.WriteLine("📖官方文档:http://www.izhaorui.cn/doc");
|
Console.WriteLine("📖官方文档:http://www.izhaorui.cn/doc");
|
||||||
Console.WriteLine("🤑打赏作者:http://www.izhaorui.cn/doc/support.html");
|
Console.WriteLine("💰打赏作者:http://www.izhaorui.cn/doc/support.html");
|
||||||
Console.WriteLine("📱移动端体验:http://www.izhaorui.cn/h5");
|
Console.WriteLine("📱移动端体验:http://www.izhaorui.cn/h5");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,6 @@
|
|||||||
using Infrastructure.Extensions;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.AspNetCore.Mvc.Filters;
|
using Microsoft.AspNetCore.Mvc.Filters;
|
||||||
using System.Data;
|
|
||||||
using ZR.Admin.WebApi.Framework;
|
|
||||||
using ZR.Model.System;
|
using ZR.Model.System;
|
||||||
using ZR.Model.System.Dto;
|
|
||||||
using ZR.Service.System;
|
using ZR.Service.System;
|
||||||
using ZR.Service.System.IService;
|
using ZR.Service.System.IService;
|
||||||
|
|
||||||
@ -41,7 +37,7 @@ namespace ZR.Admin.WebApi.Filters
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public override Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
|
public override Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
|
||||||
{
|
{
|
||||||
LoginUser info = JwtUtil.GetLoginUser(context.HttpContext);
|
TokenModel info = JwtUtil.GetLoginUser(context.HttpContext);
|
||||||
|
|
||||||
if (info != null && info?.UserId > 0)
|
if (info != null && info?.UserId > 0)
|
||||||
{
|
{
|
||||||
@ -79,7 +75,7 @@ namespace ZR.Admin.WebApi.Filters
|
|||||||
string[] denyPerms = new string[] { "update", "add", "remove", "add", "edit", "delete", "import", "run", "start", "stop", "clear", "send", "export", "upload", "common", "gencode", "reset" };
|
string[] denyPerms = new string[] { "update", "add", "remove", "add", "edit", "delete", "import", "run", "start", "stop", "clear", "send", "export", "upload", "common", "gencode", "reset" };
|
||||||
if (isDemoMode && denyPerms.Any(f => Permission.ToLower().Contains(f)))
|
if (isDemoMode && denyPerms.Any(f => Permission.ToLower().Contains(f)))
|
||||||
{
|
{
|
||||||
context.Result = new JsonResult(new { code = ResultCode.FORBIDDEN, msg = "演示模式 , 不允许操作" });
|
context.Result = new JsonResult(new { code = (int)ResultCode.FORBIDDEN, msg = "演示模式 , 不允许操作" });
|
||||||
}
|
}
|
||||||
if (!HasPermi && !Permission.Equals("common"))
|
if (!HasPermi && !Permission.Equals("common"))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,8 +2,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc.Controllers;
|
using Microsoft.AspNetCore.Mvc.Controllers;
|
||||||
using Microsoft.AspNetCore.Mvc.Filters;
|
using Microsoft.AspNetCore.Mvc.Filters;
|
||||||
using NLog;
|
using NLog;
|
||||||
using ZR.Admin.WebApi.Framework;
|
|
||||||
using ZR.Model.System.Dto;
|
|
||||||
|
|
||||||
namespace ZR.Admin.WebApi.Filters
|
namespace ZR.Admin.WebApi.Filters
|
||||||
{
|
{
|
||||||
@ -36,7 +34,7 @@ namespace ZR.Admin.WebApi.Filters
|
|||||||
var isAuthed = context.HttpContext.User.Identity.IsAuthenticated;
|
var isAuthed = context.HttpContext.User.Identity.IsAuthenticated;
|
||||||
|
|
||||||
//使用jwt token校验2020-11-21
|
//使用jwt token校验2020-11-21
|
||||||
LoginUser loginUser = JwtUtil.GetLoginUser(context.HttpContext);
|
TokenModel loginUser = JwtUtil.GetLoginUser(context.HttpContext);
|
||||||
if (loginUser != null)
|
if (loginUser != null)
|
||||||
{
|
{
|
||||||
var nowTime = DateTime.UtcNow;
|
var nowTime = DateTime.UtcNow;
|
||||||
@ -56,7 +54,7 @@ namespace ZR.Admin.WebApi.Filters
|
|||||||
if (loginUser == null || !isAuthed)
|
if (loginUser == null || !isAuthed)
|
||||||
{
|
{
|
||||||
string msg = $"请求访问[{url}]失败,无法访问系统资源";
|
string msg = $"请求访问[{url}]失败,无法访问系统资源";
|
||||||
logger.Info($"{msg}");
|
//logger.Info(msg);
|
||||||
|
|
||||||
context.Result = new JsonResult(new ApiResult((int)ResultCode.DENY, msg));
|
context.Result = new JsonResult(new ApiResult((int)ResultCode.DENY, msg));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
namespace Infrastructure.Constant
|
namespace ZR.Admin.WebApi.Hubs
|
||||||
{
|
{
|
||||||
public class HubsConstant
|
public class HubsConstant
|
||||||
{
|
{
|
||||||
@ -1,5 +1,4 @@
|
|||||||
using Infrastructure.Constant;
|
using IPTools.Core;
|
||||||
using IPTools.Core;
|
|
||||||
using Microsoft.AspNetCore.SignalR;
|
using Microsoft.AspNetCore.SignalR;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using UAParser;
|
using UAParser;
|
||||||
@ -81,7 +80,7 @@ namespace ZR.Admin.WebApi.Hubs
|
|||||||
userInfo.TodayOnlineTime = 0;
|
userInfo.TodayOnlineTime = 0;
|
||||||
}
|
}
|
||||||
var clientUser = onlineClients.Find(x => x.Userid == userid);
|
var clientUser = onlineClients.Find(x => x.Userid == userid);
|
||||||
userInfo.TodayOnlineTime += clientUser?.OnlineTime ?? 0;
|
userInfo.TodayOnlineTime += Math.Round(clientUser?.OnlineTime ?? 0, 2);
|
||||||
}
|
}
|
||||||
//给当前所有登录当前账号的用户下发登录时长
|
//给当前所有登录当前账号的用户下发登录时长
|
||||||
var connIds = onlineClients.Where(f => f.Userid == userid).ToList();
|
var connIds = onlineClients.Where(f => f.Userid == userid).ToList();
|
||||||
@ -123,7 +122,7 @@ namespace ZR.Admin.WebApi.Hubs
|
|||||||
{
|
{
|
||||||
userInfo.TodayOnlineTime += user?.OnlineTime ?? 0;
|
userInfo.TodayOnlineTime += user?.OnlineTime ?? 0;
|
||||||
}
|
}
|
||||||
Log.WriteLine(ConsoleColor.Green, msg: $"用户{user?.Name}离开了,已在线{userInfo?.TodayOnlineTime}分,当前已连接{onlineClients.Count}个");
|
Log.WriteLine(ConsoleColor.Red, msg: $"用户{user?.Name}离开了,已在线{userInfo?.TodayOnlineTime}分,当前已连接{onlineClients.Count}个");
|
||||||
}
|
}
|
||||||
return base.OnDisconnectedAsync(exception);
|
return base.OnDisconnectedAsync(exception);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,16 +1,13 @@
|
|||||||
using AspNetCoreRateLimit;
|
using AspNetCoreRateLimit;
|
||||||
using Infrastructure;
|
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
using Microsoft.AspNetCore.DataProtection;
|
using Microsoft.AspNetCore.DataProtection;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using ZR.Admin.WebApi.Extensions;
|
using ZR.Admin.WebApi.Extensions;
|
||||||
using ZR.Admin.WebApi.Filters;
|
using ZR.Admin.WebApi.Filters;
|
||||||
using ZR.Admin.WebApi.Framework;
|
|
||||||
using ZR.Admin.WebApi.Hubs;
|
using ZR.Admin.WebApi.Hubs;
|
||||||
using ZR.Admin.WebApi.Middleware;
|
using ZR.Admin.WebApi.Middleware;
|
||||||
using ZR.Common.Cache;
|
using ZR.Common.Cache;
|
||||||
using ZR.Model.System.Dto;
|
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
||||||
<PackageReference Include="Lazy.Captcha.Core" Version="2.0.3" />
|
<PackageReference Include="Lazy.Captcha.Core" Version="2.0.3" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.7" />
|
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.6" />
|
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.6" />
|
||||||
<PackageReference Include="NLog" Version="5.2.3" />
|
<PackageReference Include="NLog" Version="5.2.3" />
|
||||||
|
|||||||
@ -30,7 +30,8 @@
|
|||||||
"Audience": "ZRAdmin.NET", //指该token是服务于哪个群体的(群体范围)
|
"Audience": "ZRAdmin.NET", //指该token是服务于哪个群体的(群体范围)
|
||||||
"SecretKey": "SecretKey-ZRADMIN.NET-20210101",
|
"SecretKey": "SecretKey-ZRADMIN.NET-20210101",
|
||||||
"Expire": 1440, //jwt登录过期时间(分)
|
"Expire": 1440, //jwt登录过期时间(分)
|
||||||
"refreshTokenTime": 5
|
"RefreshTokenTime": 5,//分钟
|
||||||
|
"TokenType": "Bearer"
|
||||||
},
|
},
|
||||||
"InjectClass": [ "ZR.Repository", "ZR.Service", "ZR.Tasks" ], //自动注入类
|
"InjectClass": [ "ZR.Repository", "ZR.Service", "ZR.Tasks" ], //自动注入类
|
||||||
"ShowDbLog": true, //是否打印db日志
|
"ShowDbLog": true, //是否打印db日志
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
using Infrastructure.Extensions;
|
using Infrastructure.Extensions;
|
||||||
|
using Infrastructure.Model;
|
||||||
using JinianNet.JNTemplate;
|
using JinianNet.JNTemplate;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
|
using Infrastructure.Model;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
|
using Infrastructure.Model;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
|
using Infrastructure.Model;
|
||||||
using MailKit.Net.Smtp;
|
using MailKit.Net.Smtp;
|
||||||
using MimeKit;
|
using MimeKit;
|
||||||
using MimeKit.Text;
|
using MimeKit.Text;
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
using Infrastructure.Attribute;
|
using Infrastructure.Attribute;
|
||||||
using Infrastructure.Extensions;
|
using Infrastructure.Extensions;
|
||||||
|
using Infrastructure.Model;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user