| | |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.Authorization; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_Core.Caches; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.HttpContextUser; |
| | |
| | | public class Sys_UserController : ApiBaseController<ISys_UserService, Sys_User> |
| | | { |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | private readonly ICacheService _cacheService; |
| | | |
| | | public Sys_UserController(ISys_UserService userService, IHttpContextAccessor httpContextAccessor) : base(userService) |
| | | public Sys_UserController(ISys_UserService userService, IHttpContextAccessor httpContextAccessor, ICacheService cacheService) : base(userService) |
| | | { |
| | | _httpContextAccessor = httpContextAccessor; |
| | | _cacheService = cacheService; |
| | | } |
| | | |
| | | [HttpPost, Route("login"), AllowAnonymous] |
| | |
| | | UserName = App.User.UserName |
| | | }; |
| | | string newToken = JwtHelper.IssueJwt(tokenModelJwt); |
| | | _cacheService.AddOrUpdate(tokenModelJwt.UserId.ToString(), newToken); |
| | | return responseContent = WebResponseContent.Instance.OK(data: newToken); |
| | | } |
| | | catch (Exception ex) |