|
@@ -5,11 +5,13 @@ using Hotline.Application.Tools;
|
|
|
using Hotline.Caching.Interfaces;
|
|
|
using Hotline.Caching.Services;
|
|
|
using Hotline.FlowEngine.Workflows;
|
|
|
+using Hotline.Identity.Accounts;
|
|
|
using Hotline.Orders;
|
|
|
using Hotline.Share.Dtos.Identity;
|
|
|
using Hotline.Share.Dtos.Order;
|
|
|
using Hotline.Share.Enums.FlowEngine;
|
|
|
using Hotline.Share.Enums.Order;
|
|
|
+using Hotline.Users;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using NPOI.POIFS.Macros;
|
|
@@ -31,8 +33,10 @@ namespace Hotline.Api.Controllers
|
|
|
private readonly IOrderScreenRepository _orderScreenRepository;
|
|
|
private readonly IRepository<OrderSendBackAudit> _orderSendBackAuditRepository;
|
|
|
private readonly IRepository<OrderVisitDetail> _orderVisitedDetailRepository;
|
|
|
+ private readonly ISessionContext _sessionContext;
|
|
|
+ private readonly IRepository<Account> _accountRepository;
|
|
|
|
|
|
- public OldHotlineController(IIdentityAppService identityAppService, ISystemLogApplication iSystemLogApplication, IOrderRepository orderRepository, IOrderVisitRepository orderVisitRepository, IOrderDelayRepository orderDelayRepository, IOrderScreenRepository orderScreenRepository, IRepository<OrderSendBackAudit> orderSendBackAuditRepository, IRepository<OrderVisitDetail> orderVisitedDetailRepository)
|
|
|
+ public OldHotlineController(IIdentityAppService identityAppService, ISystemLogApplication iSystemLogApplication, IOrderRepository orderRepository, IOrderVisitRepository orderVisitRepository, IOrderDelayRepository orderDelayRepository, IOrderScreenRepository orderScreenRepository, IRepository<OrderSendBackAudit> orderSendBackAuditRepository, IRepository<OrderVisitDetail> orderVisitedDetailRepository, ISessionContext sessionContext, IRepository<Account> accountRepository)
|
|
|
{
|
|
|
_identityAppService = identityAppService;
|
|
|
_iSystemLogApplication = iSystemLogApplication;
|
|
@@ -42,6 +46,8 @@ namespace Hotline.Api.Controllers
|
|
|
_orderScreenRepository = orderScreenRepository;
|
|
|
_orderSendBackAuditRepository = orderSendBackAuditRepository;
|
|
|
_orderVisitedDetailRepository = orderVisitedDetailRepository;
|
|
|
+ _sessionContext = sessionContext;
|
|
|
+ _accountRepository = accountRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -74,7 +80,7 @@ namespace Hotline.Api.Controllers
|
|
|
/// <returns></returns>
|
|
|
[AllowAnonymous]
|
|
|
[HttpGet("ishas_canhandler")]
|
|
|
- public async Task<bool> IsHasCanHandler([FromBody] HotlineLoginOldToNewDto dto)
|
|
|
+ public async Task<bool> IsHasCanHandler([FromQuery] HotlineLoginOldToNewDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -364,5 +370,22 @@ namespace Hotline.Api.Controllers
|
|
|
}
|
|
|
return isHas;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取用户加密后的用户名
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("get_rsa_loginname")]
|
|
|
+ public async Task<string> GetRASLoginName()
|
|
|
+ {
|
|
|
+ var account = await _accountRepository.GetAsync(_sessionContext.RequiredUserId,HttpContext.RequestAborted);
|
|
|
+ if (account == null)
|
|
|
+ {
|
|
|
+ throw UserFriendlyException.SameMessage("获取用户加密失败");
|
|
|
+ }
|
|
|
+ string userName = System.Web.HttpUtility.UrlEncode(RSA.RSAEncrypt(account.UserName, RSA_Create.RSA_PUBLIC_KEY, "PEM"));
|
|
|
+ return userName;
|
|
|
+ }
|
|
|
}
|
|
|
}
|