diff --git a/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml b/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml index 86a0af5..37ed6ec 100644 --- a/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml +++ b/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml @@ -7561,6 +7561,11 @@ [账号信息]修改密码 + + + 旧密码 + + 新密码 diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountInput.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountInput.cs index 787a57e..5f26c29 100644 --- a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountInput.cs +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountInput.cs @@ -50,8 +50,12 @@ namespace BPA.MES.Base.Application /// /// [账号信息]修改密码 /// - public class AccountUpdatePwdInput: AccountInput + public class AccountUpdatePwdInput { + /// + /// 旧密码 + /// + public string OldPwd { get; set; } /// /// 新密码 /// diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Services/AuthorizeService.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Services/AuthorizeService.cs index 59df812..301d584 100644 --- a/backend/BPA.MES.Base.Application/Services/SystemService/Services/AuthorizeService.cs +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Services/AuthorizeService.cs @@ -49,6 +49,7 @@ { {ClaimConst.CLAINM_USERID, User.Id}, {ClaimConst.CLAINM_NAME,User.Name}, + {ClaimConst.CLAINM_ACCOUNT,Info.Account }, {ClaimConst.CLAINM_ISAUTH,User.IsAdmin}, {ClaimConst.CLAINM_ROLEID,User.RoleId } }, 43200); @@ -307,7 +308,8 @@ [HttpPost] public async Task EditAccountPwd(AccountUpdatePwdInput input) { - var model = db.Queryable().First(t => t.Account == input.Account && t.Pwd == input.Pwd); + var Account = App.User?.FindFirst(ClaimConst.CLAINM_ACCOUNT)?.Value; + var model = db.Queryable().First(t => t.Account == Account && t.Pwd == input.OldPwd); if (model == null) throw Oops.Bah("原密码不正确"); model.Pwd = input.NewPwd; return await db.Updateable(model).ExecuteCommandAsync() > 0;