用户信息添加修改
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user