You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
701 B

using EC.Entity.Organization;
using EC.Service.Base;
using EC.Utils.Security;
namespace EC.Service.Organization
{
public class UserService : MvcService<UserEntity>
{
public UserService()
{
}
public bool CheckLogin(string name, string pwd)
{
var user = SelectEntityByWhere($"F_Account='{name}'");
if (user != null)
{
pwd = Md5Helper.Encrypt(pwd, 32).ToLower();
var key = user.F_Secretkey;
var enStr = DesEncrypt.Encrypt(pwd, key).ToLower();
//var deStr = DesEncrypt.Decrypt(enStr, key).ToLower();
var enPwd = Md5Helper.Encrypt(enStr, 32).ToLower();
if (string.Equals(enPwd, user.F_Password))
{
return true;
}
}
return false;
}
}
}