Clothes.BLL/CLUserBLL.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using Clothes.Comment;
using Clothes.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Clothes.IDAL;
using Clothes.DAL;
using Clothes.IBLL;
namespace Clothes.BLL
{
public class CLUserBLL:CLUserIBLL
{
/// <summary>
/// 通过用户名登录
/// </summary>
/// <param name="userName"></param>
/// <param name="password"></param>
/// <returns>返回用户信息</returns>
public OperResult<CLUser> LoginByUserName(string userName, string password)
{
if (string.IsNullOrWhiteSpace(userName) || string.IsNullOrWhiteSpace(password))
{
return OperResult<CLUser>.Failed("用户名和密码不能为空!");
}
// 通过用户名查询用户
CLLoginIDAL userService = new CLLoginDAL();
CLLogin loginEntity = userService.FindByUserName(userName);
if (loginEntity == null)
{
return OperResult<CLUser>.Failed("用户名不存在!");
}
// 验证用户密码
Encryption shaEncryption = new Encryption();
if (!shaEncryption.SHA1Encryp(password).Equals(loginEntity.Password))
{
return OperResult<CLUser>.Failed("用户名或密码错误!");
}
// 查找用户信息
CLUserIDAL profileService = new CLUserDAL();
CLUser profileEntity = profileService.FindByUserId(loginEntity.Id);
// 返回结果
return OperResult<CLUser>.Success(profileEntity);
}
/// <summary>
/// 通过手机号登录
/// </summary>
/// <param name="mobileNumber"></param>
/// <param name="password"></param>
/// <returns>返回用户信息</returns>
public OperResult<CLUser> LoginByMobileNumber(string mobileNumber, string password)
{
if (string.IsNullOrWhiteSpace(mobileNumber) || string.IsNullOrWhiteSpace(password))
{
return OperResult<CLUser>.Failed("手机号和密码不能为空!");
}
// 通过用户名查询用户
后面还有 37 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。