public JsonResult SavePayPwd(string oldPwd, string pwd) { var hasPayPwd = MemberApplication.HasPayPassword(CurrentUser.Id); if (hasPayPwd && string.IsNullOrEmpty(oldPwd)) { return(Json(new { success = false, msg = "请输入旧支付密码" })); } if (string.IsNullOrWhiteSpace(pwd)) { return(Json(new { success = false, msg = "请输入新支付密码" })); } if (hasPayPwd) { var success = MemberApplication.VerificationPayPwd(CurrentUser.Id, oldPwd); if (!success) { return(Json(new { success = false, msg = "旧支付密码错误" })); } } _iMemberCapitalService.SetPayPwd(CurrentUser.Id, pwd); return(Json(new { success = true, msg = "设置成功" })); }
protected override object ChangePayPwdByOldPassword(string oldPassword, string password) { CheckUserLogin(); var _iMemberCapitalService = ServiceProvider.Instance <IMemberCapitalService> .Create; var hasPayPwd = MemberApplication.HasPayPassword(CurrentUser.Id); if (hasPayPwd && string.IsNullOrEmpty(oldPassword)) { return(Json(new { success = false, msg = "请输入旧支付密码" })); } if (string.IsNullOrWhiteSpace(password)) { return(Json(new { success = false, msg = "请输入新支付密码" })); } if (hasPayPwd) { var success = MemberApplication.VerificationPayPwd(CurrentUser.Id, oldPassword); if (!success) { return(Json(new { success = false, msg = "旧支付密码错误" })); } } _iMemberCapitalService.SetPayPwd(CurrentUser.Id, password); return(Json(new { success = true, msg = "设置成功" })); }
public ActionResult InitPayPassowrd(string password) { if (MemberApplication.HasPayPassword(CurrentUser.Id)) { throw new MallException("已设置过支付密码"); } MemberApplication.ChangePayPassword(CurrentUser.Id, password); return(Json(new { success = true }, true)); }
/// <summary> /// 设置支付密码 /// </summary> /// <param name="model"></param> /// <returns></returns> public JsonResult <Result <bool> > PostInitPayPassowrd(PostSetPasswordModel model) { CheckUserLogin(); if (MemberApplication.HasPayPassword(CurrentUser.Id)) { return(Json(ErrorResult <bool>("已设置过支付密码!"))); } MemberApplication.ChangePayPassword(CurrentUser.Id, model.password); return(JsonResult(true)); }
public ActionResult SetPayPwd() { var hasPayPwd = MemberApplication.HasPayPassword(CurrentUser.Id); var viewModel = new UserCapitalViewModels.SetPayPwdModel() { HasPawPwd = hasPayPwd }; ViewBag.Keyword = string.IsNullOrWhiteSpace(SiteSettings.SearchKeyword) ? SiteSettings.Keyword : SiteSettings.SearchKeyword; ViewBag.Keywords = SiteSettings.HotKeyWords; return(View(viewModel)); }
/// <summary> /// 申请提现页面 /// </summary> /// <returns></returns> public JsonResult <Result <dynamic> > GetApplyWithdraw() { CheckUserLogin(); var sitesettings = SiteSettingApplication.SiteSettings; dynamic result = new System.Dynamic.ExpandoObject(); var distributor = DistributionApplication.GetDistributorDTO(CurrentUser.Id); result.Balance = distributor.Balance; //账户余额 result.IsSetPassword = MemberApplication.HasPayPassword(CurrentUser.Id); //是否设置交易密码 result.MinLimit = sitesettings.DistributorWithdrawMinLimit; result.MaxLimit = sitesettings.DistributorWithdrawMaxLimit; result.Types = sitesettings.DistributorWithdrawTypes; result.EnableCapital = result.Types?.ToLower().Contains("capital") ?? false; result.EnableWeChat = result.Types?.ToLower().Contains("wechat") ?? false; result.EnableAlipay = result.Types?.ToLower().Contains("alipay") ?? false; return(JsonResult <dynamic>(result)); }
/// <summary> /// 申请提现 /// </summary> /// <returns></returns> public ActionResult ApplyWithdraw() { ViewBag.Title = "申请提现"; var distributor = DistributionApplication.GetDistributorDTO(CurrentUser.Id); ViewBag.Balance = distributor.Balance; //账户余额 ViewBag.IsSetPassword = MemberApplication.HasPayPassword(CurrentUser.Id); //是否设置交易密码 var settings = new DistributionWithdrawSettings { MinLimit = SiteSettings.DistributorWithdrawMinLimit, MaxLimit = SiteSettings.DistributorWithdrawMaxLimit, Types = SiteSettings.DistributorWithdrawTypes, }; return(View(settings)); }