Пример #1
0
        /// <summary>
        /// 登录认证
        /// </summary>
        /// <param name="loginRQ"></param>
        /// <returns></returns>
        public SysUserList Login(LoginRQ loginRQ)
        {
            var pwd  = DesCryptoUtil.Encrypt(loginRQ.password);
            var data = Wexin_User.Find(string.Format(" Username='******' and Password='******' and RoleId!=0 ", loginRQ.userId, pwd));

            if (data == null)
            {
                return(null);
            }
            return(new SysUserList()
            {
                City = data.City,
                Country = data.Country,
                Create_time = data.Create_time,
                Headimgurl = data.Headimgurl,
                Id = data.Id,
                LoginTime = data.LoginTime,
                Nickname = data.Nickname,
                Open_Id = data.Open_Id,
                Password = data.Password,
                Province = data.Province,
                Remark = data.Remark,
                RoleId = data.RoleId,
                Sex = data.Sex,
                Subscribe_time = data.Subscribe_time,
                TelePhone = data.TelePhone,
                Unionid = data.Unionid,
                Username = data.Username
            });
        }
Пример #2
0
        /// <summary>
        /// 找回密码
        /// </summary>
        /// <param name="rq"></param>
        /// <returns></returns>
        public bool FindPassword(FindPasswordRQ rq)
        {
            var newEncryptedPassword = DesCryptoUtil.Encrypt(rq.newPassword);
            var user = Wexin_User.Find(new string[] { Wexin_User._.Username, Wexin_User._.TelePhone }, new string[] { rq.saleId, rq.phone });

            if (user == null || user.Id <= 0)
            {
                return(false);
            }
            user.Password = newEncryptedPassword;
            int flag = user.Update();

            return(flag > 0 ? true : false);
        }