Browse Source

更新用户注册相关功能

refactor/repository-structure
hyh 7 months ago
parent
commit
3d41e2e275
  1. 2
      src/CellularManagement.Application/Features/Auth/Commands/RegisterUser/RegisterUserCommandHandler.cs
  2. 2
      src/CellularManagement.Application/Features/Auth/Commands/RegisterUser/RegisterUserCommandValidator.cs
  3. 1
      src/CellularManagement.Infrastructure/CellularManagement.Infrastructure.csproj

2
src/CellularManagement.Application/Features/Auth/Commands/RegisterUser/RegisterUserCommandHandler.cs

@ -75,7 +75,7 @@ public sealed class RegisterUserCommandHandler : IRequestHandler<RegisterUserCom
} }
// 获取默认角色 // 获取默认角色
var defaultRole = await _roleManager.FindByNameAsync("Admin"); var defaultRole = await _roleManager.FindByNameAsync("User");
if (defaultRole == null) if (defaultRole == null)
{ {
throw new InvalidOperationException("默认用户角色不存在"); throw new InvalidOperationException("默认用户角色不存在");

2
src/CellularManagement.Application/Features/Auth/Commands/RegisterUser/RegisterUserCommandValidator.cs

@ -9,7 +9,7 @@ namespace CellularManagement.Application.Features.Auth.Commands.RegisterUser;
public sealed class RegisterUserCommandValidator : AbstractValidator<RegisterUserCommand> public sealed class RegisterUserCommandValidator : AbstractValidator<RegisterUserCommand>
{ {
/// <summary> /// <summary>
/// 初始化验证器 /// 初始化验证器 rugqfbgcnpkdbhee
/// </summary> /// </summary>
public RegisterUserCommandValidator() public RegisterUserCommandValidator()
{ {

1
src/CellularManagement.Infrastructure/CellularManagement.Infrastructure.csproj

@ -13,6 +13,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MailKit" Version="4.12.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="8.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Authorization" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" />

Loading…
Cancel
Save