Browse Source

bug修改

master
747575620@qq.com 1 year ago
parent
commit
7125034651
3 changed files with 13 additions and 2 deletions
  1. +5
    -0
      backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml
  2. +5
    -1
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountInput.cs
  3. +3
    -1
      backend/BPA.MES.Base.Application/Services/SystemService/Services/AuthorizeService.cs

+ 5
- 0
backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml View File

@@ -7561,6 +7561,11 @@
[账号信息]修改密码
</summary>
</member>
<member name="P:BPA.MES.Base.Application.AccountUpdatePwdInput.OldPwd">
<summary>
旧密码
</summary>
</member>
<member name="P:BPA.MES.Base.Application.AccountUpdatePwdInput.NewPwd">
<summary>
新密码


+ 5
- 1
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountInput.cs View File

@@ -50,8 +50,12 @@ namespace BPA.MES.Base.Application
/// <summary>
/// [账号信息]修改密码
/// </summary>
public class AccountUpdatePwdInput: AccountInput
public class AccountUpdatePwdInput
{
/// <summary>
/// 旧密码
/// </summary>
public string OldPwd { get; set; }
/// <summary>
/// 新密码
/// </summary>


+ 3
- 1
backend/BPA.MES.Base.Application/Services/SystemService/Services/AuthorizeService.cs View File

@@ -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<bool> EditAccountPwd(AccountUpdatePwdInput input)
{
var model = db.Queryable<AccountEntity>().First(t => t.Account == input.Account && t.Pwd == input.Pwd);
var Account = App.User?.FindFirst(ClaimConst.CLAINM_ACCOUNT)?.Value;
var model = db.Queryable<AccountEntity>().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;


Loading…
Cancel
Save