Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs
@@ -41,6 +41,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 +76,8 @@
            }
            catch (Exception ex)
            {
                // 记录异常日志
                return new { result = false, message = ex.Message };
            }
            return new { result = false };
@@ -89,11 +95,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),
@@ -107,6 +119,10 @@
        {
            return WebResponseContent.Instance.OK(data: JwtHelper.SerializeJwt(code));
        }
        /// <summary>
        /// 替换Token(刷新令牌)
        /// </summary>
        /// <returns>新的Token</returns>
        [HttpPost, Route("replaceToken")]
        public WebResponseContent ReplaceToken()
        {
@@ -116,7 +132,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,7 +144,7 @@
                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)
            {