From be0856c1bf533ed6001ff786908ae98e4b853eb5 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期四, 09 一月 2025 10:09:02 +0800 Subject: [PATCH] 1 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs | 16 +++------------- 1 files changed, 3 insertions(+), 13 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs" index 4aceb97..c03ad9c 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/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) { -- Gitblit v1.9.3