Exemplo n.º 1
0
        public JsonResult EditPwd(string oldPwd, string newPwd)
        {
            SysUser user = accountBLL.Login(GetUserId(), ValueConvert.MD5(oldPwd));

            if (user == null)
            {
                return(Json(JsonHandler.CreateMessage(0, "旧密码不匹配!"), JsonRequestBehavior.AllowGet));
            }
            SysUserEditModel editModel = new SysUserEditModel();

            editModel.Id       = GetUserId();
            editModel.Password = ValueConvert.MD5(newPwd);

            if (userBLL.EditPwd(ref errors, editModel))
            {
                LogHandler.WriteServiceLog(GetUserId(), "Id:" + GetUserId() + ",密码:********", "成功", "初始化密码", "用户设置");
                return(Json(JsonHandler.CreateMessage(1, Resource.EditSucceed), JsonRequestBehavior.AllowGet));
            }
            else
            {
                string ErrorCol = errors.Error;
                LogHandler.WriteServiceLog(GetUserId(), "Id:" + GetUserId() + ",,密码:********" + ErrorCol, "失败", "初始化密码", "用户设置");
                return(Json(JsonHandler.CreateMessage(0, Resource.EditFail + ":" + ErrorCol), JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 2
0
        public IDataShell <AccountModel> Login(AccountModel user)
        {
            var res = _userBll.Login(user);

            return(res);
        }