feat: 前端添加完善头像功能

This commit is contained in:
陈淳
2023-02-23 14:37:33 +08:00
parent 272466bbbf
commit 93de208ac0
9 changed files with 50 additions and 9 deletions

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.RBAC.Application.Contracts.Identity.Dtos.Account
{
public class UpdateIconDto
{
public string? Icon { get; set; }
}
}

View File

@@ -73,6 +73,13 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Yi.RBAC.Application.Identity.AccountService.UpdateIconAsync(Yi.RBAC.Application.Contracts.Identity.Dtos.Account.UpdateIconDto)">
<summary>
更新头像
</summary>
<param name="icon"></param>
<returns></returns>
</member>
<member name="T:Yi.RBAC.Application.Identity.DeptService">
<summary>
Dept服务实现

View File

@@ -28,6 +28,7 @@ using Yi.RBAC.Domain.Identity.Repositories;
using Yi.RBAC.Domain.Shared.Identity.ConstClasses;
using Yi.RBAC.Domain.Shared.Identity.Dtos;
using Yi.RBAC.Domain.Shared.Identity.Etos;
using System.Net.WebSockets;
namespace Yi.RBAC.Application.Identity
{
@@ -188,5 +189,19 @@ namespace Yi.RBAC.Application.Identity
await _accountManager.RestPasswordAsync(userId, input.Password);
return true;
}
/// <summary>
/// 更新头像
/// </summary>
/// <param name="icon"></param>
/// <returns></returns>
public async Task<bool> UpdateIconAsync(UpdateIconDto input)
{
var entity = await _userRepository.GetByIdAsync(_currentUser.Id);
entity.Icon = input.Icon;
await _userRepository.UpdateAsync(entity);
return true;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB