|
@@ -60,7 +60,6 @@ public class HomeController : BaseController
|
|
|
/// 获取当前用户信息
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- [AllowAnonymous]
|
|
|
[HttpGet("myinfo")]
|
|
|
public async Task<User?> GetMyInfo()
|
|
|
{
|
|
@@ -91,14 +90,13 @@ public class HomeController : BaseController
|
|
|
/// 获取可选快捷入口
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- [AllowAnonymous]
|
|
|
[HttpPost("get-fastmenu")]
|
|
|
public async Task<IReadOnlyList<SystemMenu>> GetFastMenuByToken([FromBody] GetFastMenuByTokenDto dto)
|
|
|
{
|
|
|
- if (!string.IsNullOrEmpty(_sessionContext.RequiredUserId))
|
|
|
+ if (!string.IsNullOrEmpty(_sessionContext.UserId))
|
|
|
{
|
|
|
var roles = _sessionContext.Roles;
|
|
|
- return await _systemMenuRepository.GetFastMenu(roles, _sessionContext.RequiredUserId, dto.name);
|
|
|
+ return await _systemMenuRepository.GetFastMenu(roles, _sessionContext.UserId, dto.name);
|
|
|
}
|
|
|
throw UserFriendlyException.SameMessage("无效登录信息");
|
|
|
}
|
|
@@ -107,17 +105,17 @@ public class HomeController : BaseController
|
|
|
/// 设置快捷入口
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- [AllowAnonymous]
|
|
|
[HttpPost("set-fastmenu")]
|
|
|
public async Task SetFastMenu([FromBody] SetFastMenuDto dto)
|
|
|
{
|
|
|
- if (!string.IsNullOrEmpty(_sessionContext.RequiredUserId))
|
|
|
+ if (!string.IsNullOrEmpty(_sessionContext.UserId))
|
|
|
{
|
|
|
- string userId = _sessionContext.RequiredUserId;
|
|
|
+ string userId = _sessionContext.UserId;
|
|
|
var model = await _userFastMenuRepository.GetAsync(x => x.UserId == userId);
|
|
|
if (model is null)
|
|
|
{
|
|
|
var fastmenu = _mapper.Map<UserFastMenu>(dto);
|
|
|
+ fastmenu.UserId = userId;
|
|
|
await _userFastMenuRepository.AddAsync(fastmenu);
|
|
|
}
|
|
|
else
|
|
@@ -137,7 +135,6 @@ public class HomeController : BaseController
|
|
|
/// 获取我的快捷入口
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- [AllowAnonymous]
|
|
|
[HttpGet("get-myfastmenu")]
|
|
|
public async Task<IReadOnlyList<SystemMenu>> GetMyFastMenu()
|
|
|
{
|