From a38b50675f2cf8e813bd337ca2f9d9456cc421d3 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期四, 17 十月 2024 09:50:14 +0800 Subject: [PATCH] WCS --- 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs | 115 ++++++++++++++++++++++++++------------------------------- 1 files changed, 52 insertions(+), 63 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs" index dc3ea2f..e0dbf29 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs" @@ -1,67 +1,56 @@ -锘� -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using StackExchange.Profiling; -using WIDESEA_Core; -using WIDESEA_Core.Authorization; -using WIDESEA_Core.BaseController; -using WIDESEA_Core.Const; -using WIDESEA_Core.Helper; -using WIDESEA_Core.HttpContextUser; -using WIDESEA_Core.Utilities; -using WIDESEA_IServices; -using WIDESEA_Model; -using WIDESEA_Model.Models; +锘縩amespace WIDESEA_WMSServer.Controllers; -namespace WIDESEA_WMSServer.Controllers +[Route("api/Sys_User")] +[ApiController] +public class Sys_UserController : ApiBaseController<ISys_UserService, Sys_User> { - [Route("api/User")] - [ApiController] - public class Sys_UserController : ApiBaseController<ISys_UserService, Sys_User> + private readonly IHttpContextAccessor _httpContextAccessor; + + public Sys_UserController(ISys_UserService userService, IHttpContextAccessor httpContextAccessor) : base(userService) { - private readonly IHttpContextAccessor _httpContextAccessor; - - public Sys_UserController(ISys_UserService userService, IHttpContextAccessor httpContextAccessor) : base(userService) - { - _httpContextAccessor = httpContextAccessor; - } - - [HttpPost, Route("login"), AllowAnonymous] - public IActionResult Login([FromBody] LoginInfo loginInfo) - { - return Json(Service.Login(loginInfo)); - } - [HttpPost, Route("getCurrentUserInfo")] - public WebResponseContent GetCurrentUser() - { - return Service.GetCurrentUserInfo(); - } - - [HttpPost, Route("modifyPwd")] - public IActionResult ModifyPwd(string oldPwd, string newPwd) - { - return Json( Service.ModifyPwd(oldPwd, newPwd)); - } - - [HttpGet, Route("getVierificationCode"), AllowAnonymous] - public IActionResult GetVierificationCode() - { - //var html = MiniProfiler.Current.RenderIncludes(_httpContextAccessor.HttpContext); - string code = "1234" /*VierificationCode.RandomText()*/; - var data = new - { - img = VierificationCode.CreateBase64Imgage(code), - uuid = Guid.NewGuid() - }; - - return Json(data); - } - [HttpGet, Route("SerializeJwt"), AllowAnonymous] - public WebResponseContent SerializeJwt(string code) - { - return WebResponseContent.Instance.OK(data: JwtHelper.SerializeJwt(code)); - } + _httpContextAccessor = httpContextAccessor; } -} + + [HttpPost, Route("login"), AllowAnonymous] + public IActionResult Login([FromBody] LoginInfo loginInfo) + { + return Json(Service.Login(loginInfo)); + } + + [HttpPost, Route("getCurrentUserInfo")] + public WebResponseContent GetCurrentUser() + { + return Service.GetCurrentUserInfo(); + } + + [HttpPost, Route("modifyPwd")] + public IActionResult ModifyPwd(string oldPwd, string newPwd) + { + return Json(Service.ModifyPwd(oldPwd, newPwd)); + } + [HttpPost, Route("UpdateInfo")] + public IActionResult UpdateInfo(int user_Id, string roleName, string userName, string userTrueName, string address, int gender, string remark) + { + return Json(Service.UpdateInfo(user_Id, roleName, userName, userTrueName, address, gender, remark)); + } + + [HttpGet, Route("getVierificationCode"), AllowAnonymous] + public IActionResult GetVierificationCode() + { + //var html = MiniProfiler.Current.RenderIncludes(_httpContextAccessor.HttpContext); + string code = "1234" /*VierificationCode.RandomText()*/; + var data = new + { + img = VierificationCode.CreateBase64Imgage(code), + uuid = Guid.NewGuid() + }; + + return Json(data); + } + + [HttpGet, Route("SerializeJwt"), AllowAnonymous] + public WebResponseContent SerializeJwt(string code) + { + return WebResponseContent.Instance.OK(data: JwtHelper.SerializeJwt(code)); + } +} \ No newline at end of file -- Gitblit v1.9.3