public JsonResult Change(long id, string password, long roleId, string realName, string reMark) { var shopid = CurrentSellerManager.ShopId; ManagerInfo info = new ManagerInfo(); info.Id = id; info.Password = password; info.RoleId = roleId; info.RealName = realName; info.Remark = reMark; info.ShopId = shopid; _iManagerService.ChangeSellerManager(info); return(Json(new Result() { success = true, msg = "修改成功!" })); }
public object UpdateShopPassword(StorePasswordInfoModel model, string userKey) { try { long userId = UserCookieEncryptHelper.Decrypt(userKey, CookieKeysCollection.USERROLE_SELLERADMIN); IMemberService iMenberService = ServiceProvider.Instance <IMemberService> .Create; IManagerService iManagerService = ServiceProvider.Instance <IManagerService> .Create; IShopService iShopService = ServiceProvider.Instance <IShopService> .Create; UserMemberInfo memberInfo = iMenberService.GetMember(userId); if (memberInfo != null) { //修改用户账号信息 string encryptedPassword = SecureHelper.MD5(model.password); //一次MD5加密 string encryptedWithSaltPassword = SecureHelper.MD5(encryptedPassword + memberInfo.PasswordSalt); //一次结果加盐后二次加密 memberInfo.Password = encryptedWithSaltPassword; iMenberService.UpdateMemberInfo(memberInfo); //修改商家账号信息 ManagerInfo manager = iManagerService.GetSellerManager(memberInfo.Id); manager.Password = model.password; iManagerService.ChangeSellerManager(manager); //登录 ServiceProvider.Instance <IManagerService> .Create.Login(memberInfo.CellPhone, model.password); return(Json(new { success = true, msg = UserCookieEncryptHelper.Encrypt(manager.Id, CookieKeysCollection.USERROLE_SELLERADMIN) })); } else { return(Json(new { success = false, msg = "修改失败" })); } } catch (Exception ex) { return(Json(new { success = false, msg = ex.ToString() })); } }
/// <summary> /// 修改商家管理员 /// </summary> /// <param name="model"></param> public static void ChangeSellerManager(Entities.ManagerInfo info) { _iManagerService.ChangeSellerManager(info); }