Clothes.BLL/AccountManager.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using Clothes.Comment;
using Clothes.DAL;
using Clothes.IBLL;
using Clothes.IDAL;
using Clothes.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace Clothes.BLL
{
    /// <summary>
    /// 账户业务管理类
    /// </summary>
    public class AccountManager : IAccountManager
    {

        /// <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("用户名和密码不能为空!");
            }
            // 通过用户名查询用户
            IAccountService userService = new AccountService();
            CLLogin loginEntity = userService.FindByUserName(userName);
            if (loginEntity == null)
            {
                return OperResult<CLUser>.Failed("用户名不存在!");
            }
            // 验证用户密码
            SHAEncryption shaEncryption = new SHAEncryption();
            string pwd = shaEncryption.SHA1Encrypt(password);
            if (!shaEncryption.SHA1Encrypt(password).Equals(loginEntity.Password))
            {
                return OperResult<CLUser>.Failed("用户名或密码错误!");
            }
            // 查找用户信息
            IUserService profileService = new UserService();
            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)
后面还有 72 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。