Пример #1
0
        public JsonResult ChangePassword(string oldpassword, string password)
        {
            if (string.IsNullOrWhiteSpace(oldpassword) || string.IsNullOrWhiteSpace(password))
            {
                return(Json(new Result()
                {
                    success = false, msg = "密码不能为空!"
                }));
            }
            var model = CurrentManager;
            var pwd   = SecureHelper.MD5(SecureHelper.MD5(oldpassword) + model.PasswordSalt);

            if (pwd == model.Password)
            {
                _iManagerService.ChangePlatformManagerPassword(model.Id, password, 0);
                return(Json(new Result()
                {
                    success = true, msg = "修改成功"
                }));
            }
            else
            {
                return(Json(new Result()
                {
                    success = false, msg = "旧密码错误"
                }));
            }
        }
Пример #2
0
 public JsonResult ChangePassWord(long id, string password, long roleId)
 {
     _iManagerService.ChangePlatformManagerPassword(id, password, roleId);
     return(Json(new Result()
     {
         success = true, msg = "修改成功!"
     }));
 }
Пример #3
0
 public JsonResult ChangePassWord(long id, string password, long roleId)
 {
     if (DemoAuthorityHelper.IsDemo())
     {
         var manager = _iManagerService.GetPlatformManager(id);
         if (manager.UserName.ToLower() == "admin")
         {
             return(Json(new Result()
             {
                 success = false, msg = "演示数据禁止修改!"
             }));
         }
     }
     _iManagerService.ChangePlatformManagerPassword(id, password, roleId);
     return(Json(new Result()
     {
         success = true, msg = "修改成功!"
     }));
 }
Пример #4
0
 /// <summary>
 /// 修改平台管理员密码和角色
 /// </summary>
 /// <param name="model"></param>
 public static void ChangePlatformManagerPassword(long id, string password, long roleId)
 {
     _iManagerService.ChangePlatformManagerPassword(id, password, roleId);
 }