Ejemplo n.º 1
0
        public ActionResult ChangePasswordData(string pwd, string old)
        {
            if (pwd == old)
            {
                throw new BusinessException("新密码和原密码相同,请重新输入!");
            }

            UserInfo info = UserService.GetUserInfo(UserAuthHelper.GetCurrentUser().UserSysNo, UserAuthHelper.GetCurrentUser().SellerSysNo);

            if (info.Pwd != UserAuthHelper.EncryptPassword(old))
            {
                throw new BusinessException("原密码不正确!");
            }
            info.Pwd         = UserAuthHelper.EncryptPassword(pwd);
            info.VendorSysNo = UserAuthHelper.GetCurrentUser().SellerSysNo;
            UserAuthHelper.SetBizEntityUserInfo(info, false);
            UserService.UpdateUserPassword(info);
            return(new JsonResult()
            {
            });
        }
Ejemplo n.º 2
0
 public ActionResult UpdateUser(UserInfo info)
 {
     info.Roles = new List <Entity.ControlPannel.UsersRoleInfo>();
     if (Request["Roles"] != "")
     {
         foreach (var item in Request["Roles"].Split(','))
         {
             info.Roles.Add(new UsersRoleInfo()
             {
                 RoleSysNo = int.Parse(item), UserSysNo = info.SysNo
             });
         }
     }
     info.VendorSysNo = UserAuthHelper.GetCurrentUser().SellerSysNo;
     UserAuthHelper.SetBizEntityUserInfo(info, false);
     info.Pwd = UserAuthHelper.EncryptPassword(info.InputPwd);
     UserService.UpdateUser(info);
     return(new JsonResult()
     {
     });
 }