diff --git a/AGSS/AGSS.http b/AGSS/AGSS.http index 7b67830..e69de29 100644 --- a/AGSS/AGSS.http +++ b/AGSS/AGSS.http @@ -1,6 +0,0 @@ -@AGSS_HostAddress = http://localhost:5200 - -GET {{AGSS_HostAddress}}/weatherforecast/ -Accept: application/json - -### diff --git a/AGSS/Areas/Identity/Pages/Account/Login.cshtml.cs b/AGSS/Areas/Identity/Pages/Account/Login.cshtml.cs index 25f1832..99034d9 100644 --- a/AGSS/Areas/Identity/Pages/Account/Login.cshtml.cs +++ b/AGSS/Areas/Identity/Pages/Account/Login.cshtml.cs @@ -6,16 +6,19 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; +using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using AGSS.Models.Entities; using AGSS.Utilities; +using asg_form; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; namespace AGSS.Areas.Identity.Pages.Account { @@ -111,7 +114,7 @@ namespace AGSS.Areas.Identity.Pages.Account ReturnUrl = returnUrl; } - public async Task OnPostAsync(string returnUrl = null) + public async Task OnPostAsync([FromServices] IOptions jwtOptions,string returnUrl = null) { returnUrl ??= Url.Content("~/"); @@ -125,12 +128,20 @@ namespace AGSS.Areas.Identity.Pages.Account if (result.Succeeded) { _logger.LogInformation("User logged in."); - var user = await _userManager.FindByEmailAsync(Input.Email); + + var claims = new List(); + claims.Add(new Claim(ClaimTypes.NameIdentifier, user.Id.ToString())); + claims.Add(new Claim(ClaimTypes.Name, user.UserName)); var roles = await _userManager.GetRolesAsync(user); - var token = _jwt.GenerateJwtToken(user,roles); - - var frontendCallback = $"{Request.Query["frontendCallback"]}?token={token}"; + foreach (string role in roles) + { + claims.Add(new Claim(ClaimTypes.Role, role)); + } + string jwtToken = _jwt.BuildToken(claims, jwtOptions.Value); + + + var frontendCallback = $"{Request.Query["frontendCallback"]}?token={jwtToken}"; return Redirect(frontendCallback); } diff --git a/AGSS/Areas/Identity/Pages/Account/Register.cshtml.cs b/AGSS/Areas/Identity/Pages/Account/Register.cshtml.cs index 3884aff..59f2d3c 100644 --- a/AGSS/Areas/Identity/Pages/Account/Register.cshtml.cs +++ b/AGSS/Areas/Identity/Pages/Account/Register.cshtml.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; +using System.Security.Claims; using System.Text; using System.Text.Encodings.Web; using System.Threading; @@ -14,12 +15,14 @@ using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using AGSS.Models.Entities; using AGSS.Utilities; +using asg_form; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.WebUtilities; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; namespace AGSS.Areas.Identity.Pages.Account { @@ -119,7 +122,7 @@ namespace AGSS.Areas.Identity.Pages.Account ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList(); } - public async Task OnPostAsync(string returnUrl = null) + public async Task OnPostAsync([FromServices] IOptions jwtOptions,string returnUrl = null) { returnUrl ??= Url.Content("~/"); ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList(); @@ -135,10 +138,17 @@ namespace AGSS.Areas.Identity.Pages.Account if (result.Succeeded) { _logger.LogInformation("User created a new account with password."); + // var roles = await _userManager.GetRolesAsync(user); + var claims = new List(); + claims.Add(new Claim(ClaimTypes.NameIdentifier, user.Id.ToString())); + claims.Add(new Claim(ClaimTypes.Name, user.UserName)); var roles = await _userManager.GetRolesAsync(user); - var token = _jwt.GenerateJwtToken(user,roles); - - var frontendCallback = $"{Request.Query["frontendCallback"]}?token={token}"; + foreach (string role in roles) + { + claims.Add(new Claim(ClaimTypes.Role, role)); + } + string jwtToken = _jwt.BuildToken(claims, jwtOptions.Value); + var frontendCallback = $"{Request.Query["frontendCallback"]}?token={jwtToken}"; return Redirect(frontendCallback); } diff --git a/AGSS/Controllers/Admin/AdminDictionaryController.cs b/AGSS/Controllers/Admin/AdminDictionaryController.cs new file mode 100644 index 0000000..95758fe --- /dev/null +++ b/AGSS/Controllers/Admin/AdminDictionaryController.cs @@ -0,0 +1,203 @@ +using System; +using AGSS.Models.Entities; +using AGSS.Models.Template; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Mvc; +using System.Linq; +using System.Threading.Tasks; +using AGSS.DbSet; + +namespace AGSS.Controllers.Admin +{ + + [Route("api/v1/[controller]/[action]")] + public class AdminDictionaryController : ControllerBase + { + private readonly ApplicationDbContext _dbContext; + private readonly UserManager _userManager; + + public AdminDictionaryController(ApplicationDbContext dbContext, UserManager userManager) + { + _dbContext = dbContext; + _userManager = userManager; + } + + [HttpPost] + [Authorize(Roles = "Admin")] + public async Task GetParentDictionaries([FromBody] string label) + { + + + // 确保 label 不是 null + label ??= string.Empty; + + var parentDictionaries = _dbContext.Dictionaries.Where(d => d.ParentId == null && (string.IsNullOrEmpty(label) || d.Label.Contains(label))).ToList(); + return Ok(new ReturnTemplate(200, "查询成功", parentDictionaries)); + } + + [HttpPost] + [Authorize(Roles = "Admin")] + public async Task AddParentDictionary([FromBody] DictionaryModel dictionary) + { + + + if (dictionary == null || string.IsNullOrWhiteSpace(dictionary.Label) || string.IsNullOrWhiteSpace(dictionary.Value)) + { + return Ok(new ReturnTemplate(400, "请求参数无效,请提供Label和Value", null)); + } + + dictionary.Uuid = Guid.NewGuid().ToString(); + dictionary.CreateTime = DateTime.UtcNow; + dictionary.CreateUserId = _userManager.GetUserId(User); + + _dbContext.Dictionaries.Add(dictionary); + await _dbContext.SaveChangesAsync(); + + return Ok(new ReturnTemplate(200, "添加父级字典成功", dictionary)); + } + + [HttpPut] + [Authorize(Roles = "Admin")] + public async Task UpdateParentDictionary([FromBody] DictionaryModel dictionary) + { + + + if (dictionary == null || string.IsNullOrWhiteSpace(dictionary.Uuid) || string.IsNullOrWhiteSpace(dictionary.Label)) + { + return Ok(new ReturnTemplate(400, "请求参数无效,请提供Uuid和Label", null)); + } + + var existingDictionary = _dbContext.Dictionaries.FirstOrDefault(d => d.Uuid == dictionary.Uuid && d.ParentId == null); + if (existingDictionary == null) + { + return Ok(new ReturnTemplate(404, "未找到指定的父级字典", null)); + } + + existingDictionary.Label = dictionary.Label; + await _dbContext.SaveChangesAsync(); + + return Ok(new ReturnTemplate(200, "更新父级字典成功", existingDictionary)); + } + + [HttpDelete] + [Authorize(Roles = "Admin")] + public async Task DeleteParentDictionary([FromBody] string uuid) + { + + + if (string.IsNullOrWhiteSpace(uuid)) + { + return Ok(new ReturnTemplate(400, "请求参数无效,请提供Uuid", null)); + } + + var parentDictionary = _dbContext.Dictionaries.FirstOrDefault(d => d.Uuid == uuid && d.ParentId == null); + if (parentDictionary == null) + { + return Ok(new ReturnTemplate(404, "未找到指定的父级字典", null)); + } + + _dbContext.Dictionaries.RemoveRange(_dbContext.Dictionaries.Where(d => d.ParentId == uuid)); + _dbContext.Dictionaries.Remove(parentDictionary); + await _dbContext.SaveChangesAsync(); + + return Ok(new ReturnTemplate(200, "删除父级字典成功", null)); + } + + [HttpPost] + [Authorize(Roles = "Admin")] + public async Task CreateChildDictionary([FromBody] DictionaryModel dictionary) + { + + + if (dictionary == null || string.IsNullOrWhiteSpace(dictionary.ParentId) || string.IsNullOrWhiteSpace(dictionary.ParentValue) || string.IsNullOrWhiteSpace(dictionary.Label) || string.IsNullOrWhiteSpace(dictionary.Value)) + { + return Ok(new ReturnTemplate(400, "请求参数无效,请提供ParentId、ParentValue、Label和Value", null)); + } + + dictionary.Uuid = Guid.NewGuid().ToString(); + dictionary.CreateTime = DateTime.UtcNow; + dictionary.CreateUserId = _userManager.GetUserId(User); + + _dbContext.Dictionaries.Add(dictionary); + await _dbContext.SaveChangesAsync(); + + return Ok(new ReturnTemplate(200, "创建子级字典成功", dictionary)); + } + + [HttpPut] + [Authorize(Roles = "Admin")] + public async Task UpdateChildDictionary([FromBody] DictionaryModel dictionary) + { + + + if (dictionary == null || string.IsNullOrWhiteSpace(dictionary.Uuid) || string.IsNullOrWhiteSpace(dictionary.Label) || string.IsNullOrWhiteSpace(dictionary.Value)) + { + return Ok(new ReturnTemplate(400, "请求参数无效,请提供Uuid、Label和Value", null)); + } + + var existingDictionary = _dbContext.Dictionaries.FirstOrDefault(d => d.Uuid == dictionary.Uuid && d.ParentId != null); + if (existingDictionary == null) + { + return Ok(new ReturnTemplate(404, "未找到指定的子级字典", null)); + } + + existingDictionary.Label = dictionary.Label; + existingDictionary.LabelEn = dictionary.LabelEn; + existingDictionary.Remark = dictionary.Remark; + existingDictionary.Value = dictionary.Value; + existingDictionary.Tag = dictionary.Tag; + await _dbContext.SaveChangesAsync(); + + return Ok(new ReturnTemplate(200, "更新子级字典成功", existingDictionary)); + } + + [HttpDelete] + [Authorize(Roles = "Admin")] + public async Task DeleteChildDictionary([FromBody] string uuid) + { + + if (string.IsNullOrWhiteSpace(uuid)) + { + return Ok(new ReturnTemplate(400, "请求参数无效,请提供Uuid", null)); + } + + var childDictionary = _dbContext.Dictionaries.FirstOrDefault(d => d.Uuid == uuid && d.ParentId != null); + if (childDictionary == null) + { + return Ok(new ReturnTemplate(404, "未找到指定的子级字典", null)); + } + + _dbContext.Dictionaries.Remove(childDictionary); + await _dbContext.SaveChangesAsync(); + + return Ok(new ReturnTemplate(200, "删除子级字典成功", null)); + } + + [HttpGet] + public IActionResult GetChildDictionaries([FromBody] ChildDictionaryRequest request) + { + if (string.IsNullOrWhiteSpace(request.Value)) + { + return Ok(new ReturnTemplate(400, "请求参数无效,请提供Value", null)); + } + + var childDictionaries = _dbContext.Dictionaries + .Where(d => d.ParentValue == request.Value && + (request.Tag == null || (!string.IsNullOrEmpty(d.Tag) && d.Tag.Contains("," + request.Tag + ",")))) + .ToList(); + + if (request.Tag != null) + { + childDictionaries = childDictionaries.Where(d => !string.IsNullOrEmpty(d.Tag)).ToList(); + } + + return Ok(new ReturnTemplate(200, "查询成功", childDictionaries)); + } + public class ChildDictionaryRequest + { + public string Value { get; set; } + public string Tag { get; set; } + } + } +} \ No newline at end of file diff --git a/AGSS/Controllers/Admin/AdminRoleControllers.cs b/AGSS/Controllers/Admin/AdminRoleControllers.cs index 5e16ab2..d235cbe 100644 --- a/AGSS/Controllers/Admin/AdminRoleControllers.cs +++ b/AGSS/Controllers/Admin/AdminRoleControllers.cs @@ -1,7 +1,11 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; using AGSS.Models.DTOs; using AGSS.Models.Entities; using AGSS.Models.Template; using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; @@ -11,7 +15,7 @@ namespace AGSS.Controllers.Admin; /// 控制器类,用于管理角色相关的操作,包括添加角色、分配角色给用户以及通过角色查询用户。 /// 该控制器仅限具有"Admin"角色的用户访问。 /// -[Authorize(Roles = "Admin")] +[Authorize] [Route("api/v1/[controller]/[action]")] public class AdminRoleControllers:ControllerBase { @@ -44,18 +48,15 @@ public class AdminRoleControllers:ControllerBase /// 要添加的角色信息 /// 返回操作结果,包含状态码、消息和数据 [HttpPost] - public async Task AddRole([FromBody] RoleModel role) + public async Task AddRole(string rolename) { - if (role == null || string.IsNullOrWhiteSpace(role.Name)) - { - - return Ok(new ReturnTemplate(400,"创建失败,请提供名字","")); - } + + - var result = await _roleManager.CreateAsync(role); + var result = await _roleManager.CreateAsync(new RoleModel(){Id = new Guid().ToString(),Name = rolename,NormalizedName = rolename}); if (result.Succeeded) { - return Ok(new ReturnTemplate(200,"创建成功",role)); + return Ok(new ReturnTemplate(200,"创建成功","")); } else diff --git a/AGSS/DbSet/UserSet.cs b/AGSS/DbSet/UserSet.cs index 6d1fb54..a2dbb4d 100644 --- a/AGSS/DbSet/UserSet.cs +++ b/AGSS/DbSet/UserSet.cs @@ -9,6 +9,7 @@ namespace AGSS.DbSet public override DbSet Users { get; set; } public override DbSet Roles { get; set; } + public DbSet Dictionaries { get; set; } public ApplicationDbContext(DbContextOptions options) : base(options) @@ -20,6 +21,11 @@ namespace AGSS.DbSet { base.OnModelCreating(modelBuilder); + + modelBuilder.Entity() + .HasKey(d => d.Uuid); // 假设 Id 是 DictionaryModel 的主键字段 + + // 在这里添加额外的配置,如果需要的话 // 例如: // modelBuilder.Entity().ToTable("CustomUsers"); diff --git a/AGSS/Migrations/ApplicationDbContextModelSnapshot.cs b/AGSS/Migrations/ApplicationDbContextModelSnapshot.cs index 058cb5a..57eb2fc 100644 --- a/AGSS/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/AGSS/Migrations/ApplicationDbContextModelSnapshot.cs @@ -22,6 +22,51 @@ namespace AGSS.Migrations NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + modelBuilder.Entity("AGSS.Models.Entities.DictionaryModel", b => + { + b.Property("Uuid") + .HasColumnType("text"); + + b.Property("CreateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("CreateUserId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Label") + .IsRequired() + .HasColumnType("text"); + + b.Property("LabelEn") + .IsRequired() + .HasColumnType("text"); + + b.Property("ParentId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ParentValue") + .IsRequired() + .HasColumnType("text"); + + b.Property("Remark") + .IsRequired() + .HasColumnType("text"); + + b.Property("Tag") + .IsRequired() + .HasColumnType("text"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Uuid"); + + b.ToTable("Dictionaries"); + }); + modelBuilder.Entity("AGSS.Models.Entities.RoleModel", b => { b.Property("Id") diff --git a/AGSS/Models/DBContext.cs b/AGSS/Models/DBContext.cs deleted file mode 100644 index f49ba8b..0000000 --- a/AGSS/Models/DBContext.cs +++ /dev/null @@ -1,14 +0,0 @@ -using AGSS.Models.Entities; -using Microsoft.EntityFrameworkCore; - -namespace AGSS.Models; - -public class DBContext : DbContext -{ - public DBContext(DbContextOptions options) - : base(options) - { - } - - -} \ No newline at end of file diff --git a/AGSS/Models/DTOs/DictionaryDto.cs b/AGSS/Models/DTOs/DictionaryDto.cs new file mode 100644 index 0000000..9558932 --- /dev/null +++ b/AGSS/Models/DTOs/DictionaryDto.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +namespace AGSS.Models.DTOs +{ + public class DictionaryDto + { + public string Uuid { get; set; } + public string ParentId { get; set; } + public string ParentValue { get; set; } + public string Label { get; set; } + public string LabelEn { get; set; } + public string Remark { get; set; } + public string Value { get; set; } + public string Tag { get; set; } + } +} diff --git a/AGSS/Models/Entities/DictionaryModel.cs b/AGSS/Models/Entities/DictionaryModel.cs new file mode 100644 index 0000000..77269e1 --- /dev/null +++ b/AGSS/Models/Entities/DictionaryModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +namespace AGSS.Models.Entities +{ + public class DictionaryModel + { + public string Uuid { get; set; } + public string ParentId { get; set; } + public string ParentValue { get; set; } + public string Label { get; set; } + public string LabelEn { get; set; } + public string Remark { get; set; } + public string Value { get; set; } + public string Tag { get; set; } + public DateTime CreateTime { get; set; } + public string CreateUserId { get; set; } + } +} diff --git a/AGSS/Models/Entities/JwtModel.cs b/AGSS/Models/Entities/JwtModel.cs new file mode 100644 index 0000000..6882ed9 --- /dev/null +++ b/AGSS/Models/Entities/JwtModel.cs @@ -0,0 +1,9 @@ +namespace asg_form +{ + public class JWTOptions + { + public string SigningKey { get; set; } + public int ExpireSeconds { get; set; } + } + +} diff --git a/AGSS/Program.cs b/AGSS/Program.cs index 427490c..c970228 100644 --- a/AGSS/Program.cs +++ b/AGSS/Program.cs @@ -5,6 +5,7 @@ using AGSS.Models; using AGSS.Models.Entities; using AGSS.Models.Template; using AGSS.Utilities; +using asg_form; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; @@ -33,49 +34,48 @@ builder.Services.AddDbContext(opt => opt.UseNpgsql(builder.Configuration.GetConnectionString("DBContext"))); // Identity 配置 -builder.Services.AddIdentity() - .AddEntityFrameworkStores() - .AddDefaultTokenProviders() - .AddDefaultUI(); +builder.Services.AddIdentityCore(options => +{ + options.Password.RequireDigit = false; + options.Password.RequireLowercase = false; + options.Password.RequireNonAlphanumeric = false; + options.Password.RequireUppercase = false; + options.Password.RequiredLength = 6; + options.Tokens.PasswordResetTokenProvider = TokenOptions.DefaultEmailProvider; + options.Tokens.EmailConfirmationTokenProvider = TokenOptions.DefaultEmailProvider; +}) +.AddRoles() +.AddEntityFrameworkStores() +.AddDefaultUI() +; // 注册 UserService - builder.Services.AddScoped(); + // builder.Services.AddScoped(); builder.Services.AddScoped(); -builder.Services.AddAuthentication(options => + + + + +builder.Services.Configure(builder.Configuration.GetSection("JWT")); + +builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + .AddJwtBearer(x => { - options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme; - options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; - }) - .AddJwtBearer(options => - { - options.TokenValidationParameters = new TokenValidationParameters + var jwtOpt = builder.Configuration.GetSection("JWT").Get(); + byte[] keyBytes = Encoding.UTF8.GetBytes(jwtOpt.SigningKey); + var secKey = new SymmetricSecurityKey(keyBytes); + x.TokenValidationParameters = new() { - ValidateIssuer = true, - ValidateAudience = true, + ValidateIssuer = false, + ValidateAudience = false, ValidateLifetime = true, ValidateIssuerSigningKey = true, - ValidIssuer = builder.Configuration["Jwt:Issuer"], - ValidAudience = builder.Configuration["Jwt:Audience"], - IssuerSigningKey = new SymmetricSecurityKey( - Encoding.UTF8.GetBytes(builder.Configuration["Jwt:Key"])) + IssuerSigningKey = secKey }; - options.Events = new JwtBearerEvents - { - OnChallenge = context => - { - context.HandleResponse(); - context.Response.StatusCode = 200; - context.Response.ContentType = "application/json"; - return context.Response.WriteAsJsonAsync(new ReturnTemplate(401, "你提供了一个错误的Token,所以我们无法验证你的身份,唔......", null)); - } - }; - }).AddMicrosoftAccount(microsoftOptions => - { - microsoftOptions.ClientId = configuration["Authentication:Microsoft:ClientId"]; - microsoftOptions.ClientSecret = configuration["Authentication:Microsoft:ClientSecret"]; - }); + }) + .AddCookie("Identity.External"); diff --git a/AGSS/Utilities/Jwt.cs b/AGSS/Utilities/Jwt.cs index 6d3c49f..ed86907 100644 --- a/AGSS/Utilities/Jwt.cs +++ b/AGSS/Utilities/Jwt.cs @@ -2,23 +2,19 @@ using System.IdentityModel.Tokens.Jwt; using System.Security.Claims; using System.Text; using AGSS.Models.Entities; +using asg_form; using Microsoft.IdentityModel.Tokens; namespace AGSS.Utilities; public class Jwt { - private readonly IConfiguration _configuration; + - public Jwt(IConfiguration configuration) + public string BuildToken(IEnumerable claims, JWTOptions options) { - _configuration = configuration; - } - - public string BuildToken(IEnumerable claims) - { - DateTime expires = DateTime.Now.AddDays(int.Parse(_configuration["Jwt:ExpireMinutes"])); - byte[] keyBytes = Encoding.UTF8.GetBytes(_configuration["Jwt:Key"]); + DateTime expires = DateTime.Now.AddSeconds(options.ExpireSeconds); + byte[] keyBytes = Encoding.UTF8.GetBytes(options.SigningKey); var secKey = new SymmetricSecurityKey(keyBytes); var credentials = new SigningCredentials(secKey, @@ -27,18 +23,4 @@ public class Jwt signingCredentials: credentials, claims: claims); return new JwtSecurityTokenHandler().WriteToken(tokenDescriptor); } - - public string GenerateJwtToken(UserModel user,IList roles) - { - var claims = new List(); - claims.Add(new Claim(JwtRegisteredClaimNames.Sub, user.Id.ToString())); - claims.Add(new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString())); - // var roles = await user.GetRolesAsync(user); - foreach (string role in roles) - { - claims.Add(new Claim(ClaimTypes.Role, role)); - } - string jwtToken = BuildToken(claims); - return jwtToken; - } } \ No newline at end of file diff --git a/AGSS/appsettings.Development.json b/AGSS/appsettings.Development.json index d1c269e..021d945 100644 --- a/AGSS/appsettings.Development.json +++ b/AGSS/appsettings.Development.json @@ -18,7 +18,7 @@ "ExpireMinutes": "4", "Issuer": "https://api.zeronode.cn/api", "Audience": "https://api.zeronode.cn/api", - "Key": "7wU9bdVfBsX3jITh0w4bgE6fkvLk8pIcZRSUw6r8HQUnXfslYxlx4c4E0ZAIw4Ak" + "SigningKey": "7wU9bdVfBsX3jITh0w4bgE6fkvLk8pIcZRSUw6r8HQUnXfslYxlx4c4E0ZAIw4Ak" }, "ConnectionStrings": { "DBContext": "Host=localhost;Port=5432;Database=postgres;Username=postgres;Password=luolan12323;" diff --git a/AGSS/appsettings.json b/AGSS/appsettings.json index 6527a3d..6e8922d 100644 --- a/AGSS/appsettings.json +++ b/AGSS/appsettings.json @@ -14,11 +14,11 @@ }, "AllowedHosts": "*", - "Jwt": { + "JWT": { "ExpireMinutes": "4", "Issuer": "https://api.zeronode.cn/api", "Audience": "https://api.zeronode.cn/api", - "Key": "7wU9bdVfBsX3jITh0w4bgE6fkvLk8pIcZRSUw6r8HQUnXfslYxlx4c4E0ZAIw4Ak" + "SigningKey": "7wU9bdVfBsX3jITh0w4bgE6fkvLk8pIcZRSUw6r8HQUnXfslYxlx4c4E0ZAIw4Ak" }, "ConnectionStrings": { "DBContext": "Host=1Panel-postgresql-auKB;Port=5432;Database=zeronode;Username=zeronode;Password=luolan12323;"