Skip to content

Commit

Permalink
调整创建用户
Browse files Browse the repository at this point in the history
  • Loading branch information
maikebing committed Nov 8, 2022
1 parent 2650885 commit 0b2360b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 0 additions & 3 deletions IoTSharp/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,7 @@ public async Task<ApiResult<LoginResult>> CreateUser([FromBody] CreateUserDto mo
await _signInManager.UserManager.AddClaimAsync(user, new Claim(ClaimTypes.Email, model.Email));
await _signInManager.UserManager.AddClaimAsync(user, new Claim(IoTSharpClaimTypes.Customer, model.Customer.ToString()));
await _signInManager.UserManager.AddClaimAsync(user, new Claim(IoTSharpClaimTypes.Tenant, tid.ToString()));
await _signInManager.UserManager.AddToRoleAsync(user, nameof(UserRole.Anonymous));
await _signInManager.UserManager.AddToRoleAsync(user, nameof(UserRole.NormalUser));
await _signInManager.UserManager.AddToRoleAsync(user, nameof(UserRole.CustomerAdmin));
await _signInManager.UserManager.AddToRoleAsync(user, nameof(UserRole.TenantAdmin));
var rship = new Relationship
{
IdentityUser = _context.Users.Find(user.Id),
Expand Down
6 changes: 4 additions & 2 deletions IoTSharp/Dtos/CreateUserDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace IoTSharp.Dtos
public class CreateUserDto
{
/// <summary>
/// 系统管理员用户名
/// 用户邮箱
/// </summary>
[Required]
[EmailAddress]
Expand All @@ -24,7 +24,9 @@ public class CreateUserDto
/// </summary>
[Phone]
public string PhoneNumber { get; set; }

/// <summary>
/// 客户的ID
/// </summary>
public Guid Customer { get; set; }

}
Expand Down
7 changes: 6 additions & 1 deletion IoTSharp/IoTSharp.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0b2360b

Please sign in to comment.