用户信息添加修改

This commit is contained in:
chenchun
2022-09-11 12:39:22 +08:00
parent d001a0de15
commit 0cd3bea6bd
10 changed files with 158 additions and 55 deletions

View File

@@ -2,6 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using SqlSugar;
using Yi.Framework.Common.Helper;
namespace Yi.Framework.Model.Models
{
public partial class UserEntity
@@ -26,5 +28,19 @@ namespace Yi.Framework.Model.Models
this.Salt = Common.Helper.MD5Helper.GenerateSalt();
this.Password = Common.Helper.MD5Helper.SHA2Encode(password, this.Salt);
}
/// <summary>
/// 判断密码和加密后的密码是否相同
/// </summary>
/// <param name="password"></param>
/// <returns></returns>
public bool JudgePassword(string password)
{
if (this.Password == MD5Helper.SHA2Encode(password, this.Salt))
{
return true;
}
return false;
}
}
}