Пример #1
0
        public ActionResult LogIn(LoginModel model, string returnUrl)
        {
            try
            {
                var md5Pwd = IMS_UP_YH.GetPwdMD5(model.Password);

                if (membership.ValidateUser(model.UserID, md5Pwd))
                {
                    formAuth.SignIn(model.UserID, false);

                    string url = RedirectToLocal(returnUrl);
                    return(this.JsonFormat(new ExtResult {
                        success = true, msg = url
                    }));
                }

                return(this.JsonFormat(new ExtResult {
                    success = false, msg = "提供的用户名或密码不正确"
                }));
            }
            catch (Exception ex)
            {
                return(this.JsonFormat(new ExtResult {
                    success = false, msg = ex.Message
                }));
            }
        }
Пример #2
0
        public ActionResult Registion(IMS_UP_YH user)
        {
            Func <ExtResult> saveFun = () =>
            {
                // 新增用户,密码需要md5一下
                user.MM = IMS_UP_YH.GetPwdMD5(user.MM);

                dalUser.SaveOrUpdate(user);

                ExtResult ret = new ExtResult();
                ret.success = true;
                return(ret);
            };

            return(base.Save(saveFun));
        }
Пример #3
0
        public ActionResult ChangePassword(ChangePasswordModule module)
        {
            var user = dalUser.GetEntity(module.ID);

            user.MM = IMS_UP_YH.GetPwdMD5(module.NewPassword);

            Func <ExtResult> saveFun = () =>
            {
                dalUser.SaveOrUpdate(user);

                ExtResult ret = new ExtResult();
                ret.success = true;
                return(ret);
            };

            return(base.Save(saveFun));
        }