dengjunjie
2025-01-10 063fc95895b19118df5c58723358671d7445ccdd
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs
@@ -29,6 +29,7 @@
        {
            _httpContextAccessor = httpContextAccessor;
        }
        [HttpPost, Route("swgLogin"), AllowAnonymous]
        public dynamic SwgLogin([FromBody] SwaggerLoginRequest loginRequest)
        {
@@ -39,21 +40,9 @@
            try
            {
                LoginInfo loginInfo = new LoginInfo
                {
                    Password = loginRequest.pwd,
                    UserName = loginRequest.name
                };
                var result = Service.Login(loginInfo);
                if (result.Status)
                if (loginRequest.name == "admin" && loginRequest.pwd == $"admin!{DateTime.Now.ToString("yyyyMMdd")}")
                {
                    HttpContext.SuccessSwagger();
                    Dictionary<string, object>? dict = JsonConvert.DeserializeObject<Dictionary<string, object>>(result.Data.Serialize());
                    if (dict != null)
                    {
                        HttpContext.SuccessSwaggerJwt((dict.ContainsKey("token") ? dict["token"].ToString() : "") ?? "");
                    }
                    string str = HttpContext.GetSuccessSwaggerJwt();
                    return new { result = true };
                }
            }
@@ -64,6 +53,7 @@
            return new { result = false };
        }
        [HttpPost, Route("login"), AllowAnonymous]
        public IActionResult Login([FromBody] LoginInfo loginInfo)
        {