From 4b483d9d06bead231b88ca212fd799196668a057 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期二, 28 四月 2026 22:58:27 +0800
Subject: [PATCH] fix(任务服务): 修复出库任务选择逻辑和货位分配问题

---
 Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs |   41 +++++++++++++++++++++++++++--------------
 1 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs
index 0d42fac..cee5a84 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs
@@ -1,17 +1,12 @@
 锘縰sing Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
-using Microsoft.Extensions.Caching.Memory;
 using Newtonsoft.Json;
-using StackExchange.Profiling;
 using WIDESEA_Core;
 using WIDESEA_Core.Authorization;
 using WIDESEA_Core.BaseController;
 using WIDESEA_Core.Caches;
-using WIDESEA_Core.Const;
 using WIDESEA_Core.Extensions;
 using WIDESEA_Core.Helper;
-using WIDESEA_Core.HttpContextUser;
 using WIDESEA_Core.Utilities;
 using WIDESEA_ISystemService;
 using WIDESEA_Model;
@@ -41,6 +36,11 @@
             return Json(Service.Login(loginInfo));
         }
 
+        /// <summary>
+        /// Swagger 鐧诲綍鎺ュ彛
+        /// </summary>
+        /// <param name="loginRequest">鐧诲綍璇锋眰</param>
+        /// <returns>鐧诲綍缁撴灉</returns>
         [HttpPost, Route("swgLogin"), AllowAnonymous]
         public dynamic SwgLogin([FromBody] SwaggerLoginRequest loginRequest)
         {
@@ -71,7 +71,8 @@
             }
             catch (Exception ex)
             {
-
+                // 璁板綍寮傚父鏃ュ織
+                return new { result = false, message = ex.Message };
             }
 
             return new { result = false };
@@ -89,11 +90,17 @@
             return Json(Service.ModifyPwd(oldPwd, newPwd));
         }
 
+        /// <summary>
+        /// 鑾峰彇楠岃瘉鐮�
+        /// 娉ㄦ剰锛氬綋鍓嶇増鏈娇鐢ㄥ浐瀹氶獙璇佺爜 "1234" 鐢ㄤ簬娴嬭瘯
+        /// </summary>
+        /// <returns>楠岃瘉鐮佸浘鐗囧拰鍞竴鏍囪瘑</returns>
         [HttpGet, Route("getVierificationCode"), AllowAnonymous]
         public IActionResult GetVierificationCode()
         {
-            //var html = MiniProfiler.Current.RenderIncludes(_httpContextAccessor.HttpContext);
-            string code = "1234" /*VierificationCode.RandomText()*/;
+            // TODO: 鐢熶骇鐜搴斿惎鐢ㄧ湡瀹為獙璇佺爜鐢熸垚
+            // var html = MiniProfiler.Current.RenderIncludes(_httpContextAccessor.HttpContext);
+            string code = "1234"; // 娴嬭瘯鐢ㄥ浐瀹氶獙璇佺爜锛岀敓浜х幆澧冨簲浣跨敤 VierificationCode.RandomText()
             var data = new
             {
                 img = VierificationCode.CreateBase64Imgage(code),
@@ -102,11 +109,17 @@
 
             return Json(data);
         }
+
         [HttpGet, Route("SerializeJwt"), AllowAnonymous]
         public WebResponseContent SerializeJwt(string code)
         {
             return WebResponseContent.Instance.OK(data: JwtHelper.SerializeJwt(code));
         }
+
+        /// <summary>
+        /// 鏇挎崲Token锛堝埛鏂颁护鐗岋級
+        /// </summary>
+        /// <returns>鏂扮殑Token</returns>
         [HttpPost, Route("replaceToken")]
         public WebResponseContent ReplaceToken()
         {
@@ -116,7 +129,7 @@
                 string token = App.User.GetToken();
                 if (string.IsNullOrEmpty(token))
                 {
-                    return responseContent = WebResponseContent.Instance.Error("token鏃犳晥锛岃閲嶆柊鐧诲綍锛�");
+                    return responseContent.Error("Token鏃犳晥锛岃閲嶆柊鐧诲綍锛�");
                 }
                 TokenModelJwt tokenModelJwt = new TokenModelJwt()
                 {
@@ -128,24 +141,24 @@
                 string newToken = JwtHelper.IssueJwt(tokenModelJwt);
 
                 App.User.UpdateToke(newToken, App.User.UserId);
-                return responseContent = WebResponseContent.Instance.OK(data: newToken);
+                return responseContent.OK(data: newToken);
             }
             catch (Exception ex)
             {
                 return responseContent.Error(ex.Message);
             }
-
         }
+
         /// <summary>
         /// 鏇存柊瀵嗙爜
         /// </summary>
         /// <param name="password">瀵嗙爜</param>
         /// <param name="userName">鐢ㄦ埛鍚�</param>
         /// <returns></returns>
-        [HttpPost,Route("ModifyUserPwd")]
+        [HttpPost, Route("ModifyUserPwd")]
         public WebResponseContent ModifyUserPwd(string password, string userName)
         {
-            return Service.ModifyUserPwd(password,userName);
+            return Service.ModifyUserPwd(password, userName);
         }
     }
 
@@ -154,4 +167,4 @@
         public string name { get; set; }
         public string pwd { get; set; }
     }
-}
+}
\ No newline at end of file

--
Gitblit v1.9.3