hutongqing
2024-08-28 d0f01f571918ae942349068776fa7fb70f3ab5cd
WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs
@@ -42,7 +42,7 @@
        [HttpPost, Route("modifyPwd")]
        public IActionResult ModifyPwd(string oldPwd, string newPwd)
        {
            return Json( Service.ModifyPwd(oldPwd, newPwd));
            return Json(Service.ModifyPwd(oldPwd, newPwd));
        }
        [HttpGet, Route("getVierificationCode"), AllowAnonymous]
@@ -63,5 +63,32 @@
        {
            return WebResponseContent.Instance.OK(data: JwtHelper.SerializeJwt(code));
        }
        [HttpPost, Route("replaceToken")]
        public WebResponseContent ReplaceToken()
        {
            WebResponseContent responseContent = new WebResponseContent();
            try
            {
                string token = App.User.GetToken();
                if (string.IsNullOrEmpty(token))
                {
                    return responseContent = WebResponseContent.Instance.Error("token无效,请重新登录!");
                }
                TokenModelJwt tokenModelJwt = new TokenModelJwt()
                {
                    RoleId = App.User.RoleId,
                    TenantId = App.User.TenantId,
                    UserId = App.User.UserId,
                    UserName = App.User.UserName
                };
                string newToken = JwtHelper.IssueJwt(tokenModelJwt);
                return responseContent = WebResponseContent.Instance.OK(data: newToken);
            }
            catch (Exception ex)
            {
                return responseContent.Error(ex.Message);
            }
        }
    }
}