Commit f7c90817 authored by liudong1993's avatar liudong1993
parents 534f27c8 cd2721d6
...@@ -92,31 +92,31 @@ namespace Mall.Common.Pay.WeChatPat ...@@ -92,31 +92,31 @@ namespace Mall.Common.Pay.WeChatPat
} }
} }
/// <summary> ///// <summary>
/// 获取package带参数的签名包 ///// 获取package带参数的签名包
/// </summary> ///// </summary>
/// <returns></returns> ///// <returns></returns>
public string GetRequestURL() //public string GetRequestURL()
{ //{
this.CreateMd5Sign(); // this.CreateMd5Sign();
var sb = new StringBuilder(); // var sb = new StringBuilder();
var akeys = new ArrayList(Parameters.Keys); // var akeys = new ArrayList(Parameters.Keys);
akeys.Sort(); // akeys.Sort();
foreach (string k in akeys) // foreach (string k in akeys)
{ // {
var v = (string)Parameters[k]; // var v = (string)Parameters[k];
if (null != v && String.Compare("key", k, StringComparison.Ordinal) != 0) // if (null != v && String.Compare("key", k, StringComparison.Ordinal) != 0)
{ // {
sb.Append(k + "=" + UrlEncode(v, GetCharset()) + "&"); // sb.Append(k + "=" + UrlEncode(v, GetCharset()) + "&");
} // }
} // }
//去掉最后一个& // //去掉最后一个&
if (sb.Length > 0) // if (sb.Length > 0)
{ // {
sb.Remove(sb.Length - 1, 1); // sb.Remove(sb.Length - 1, 1);
} // }
return sb.ToString(); // return sb.ToString();
} //}
...@@ -172,7 +172,7 @@ namespace Mall.Common.Pay.WeChatPat ...@@ -172,7 +172,7 @@ namespace Mall.Common.Pay.WeChatPat
/// 创建package签名,按参数名称a-z排序,遇到空值的参数不参加签名。 /// 创建package签名,按参数名称a-z排序,遇到空值的参数不参加签名。
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public string CreateMd5Sign(IHttpContextAccessor accessor) public string CreateMd5Sign(IHttpContextAccessor accessor, string WeChatApiSecret)
{ {
var sb = new StringBuilder(); var sb = new StringBuilder();
var akeys = new ArrayList(Parameters.Keys); var akeys = new ArrayList(Parameters.Keys);
...@@ -186,7 +186,8 @@ namespace Mall.Common.Pay.WeChatPat ...@@ -186,7 +186,8 @@ namespace Mall.Common.Pay.WeChatPat
sb.Append(k + "=" + v + "&"); sb.Append(k + "=" + v + "&");
} }
} }
sb.Append("key=" + GetKey()); // sb.Append("key=" + GetKey());
sb.Append("key=" + WeChatApiSecret);
var sign = Plugin.SecurityHelper.MD5EncryptWeChat(sb.ToString(), GetCharset(accessor)).ToUpper(); var sign = Plugin.SecurityHelper.MD5EncryptWeChat(sb.ToString(), GetCharset(accessor)).ToUpper();
return sign; return sign;
} }
......
...@@ -25,15 +25,16 @@ namespace Mall.Model.Entity.User ...@@ -25,15 +25,16 @@ namespace Mall.Model.Entity.User
/// <summary> /// <summary>
/// 头部图片 /// 头部图片
/// </summary> /// </summary>
public int? HeadImage public string HeadImage
{ {
get; get;
set; set;
} }
/// <summary> /// <summary>
/// 底部图片 /// 底部图片
/// </summary> /// </summary>
public int? BottomImage public string BottomImage
{ {
get; get;
set; set;
...@@ -97,7 +98,7 @@ namespace Mall.Model.Entity.User ...@@ -97,7 +98,7 @@ namespace Mall.Model.Entity.User
/// <summary> /// <summary>
/// 分销佣金图片 /// 分销佣金图片
/// </summary> /// </summary>
public int? DistributionCommissionImage public string DistributionCommissionImage
{ {
get; get;
set; set;
...@@ -113,7 +114,7 @@ namespace Mall.Model.Entity.User ...@@ -113,7 +114,7 @@ namespace Mall.Model.Entity.User
/// <summary> /// <summary>
/// 分销订单图片 /// 分销订单图片
/// </summary> /// </summary>
public int? DistributionOrderImage public string DistributionOrderImage
{ {
get; get;
set; set;
...@@ -129,7 +130,7 @@ namespace Mall.Model.Entity.User ...@@ -129,7 +130,7 @@ namespace Mall.Model.Entity.User
/// <summary> /// <summary>
/// 提现明细图片 /// 提现明细图片
/// </summary> /// </summary>
public int? WithdrawDetialsImage public string WithdrawDetialsImage
{ {
get; get;
set; set;
...@@ -145,7 +146,7 @@ namespace Mall.Model.Entity.User ...@@ -145,7 +146,7 @@ namespace Mall.Model.Entity.User
/// <summary> /// <summary>
/// 我的团队图片 /// 我的团队图片
/// </summary> /// </summary>
public int? MyTeamImage public string MyTeamImage
{ {
get; get;
set; set;
...@@ -161,7 +162,7 @@ namespace Mall.Model.Entity.User ...@@ -161,7 +162,7 @@ namespace Mall.Model.Entity.User
/// <summary> /// <summary>
/// 推广二维码图片 /// 推广二维码图片
/// </summary> /// </summary>
public int? PromoteQRCodeImage public string PromoteQRCodeImage
{ {
get; get;
set; set;
......
...@@ -111,23 +111,23 @@ namespace Mall.Module.User ...@@ -111,23 +111,23 @@ namespace Mall.Module.User
{ {
Id = 0, Id = 0,
ApplicationAgreement = "分销申请协议", ApplicationAgreement = "分销申请协议",
HeadImage = 1, HeadImage =Common.Config.GetFileUrl("/Upload/Set/1587968479000.png"),
BottomImage = 2, BottomImage = Common.Config.GetFileUrl("/Upload/Set/1587968716000.png"),
ButtonColor = "#FF4544", ButtonColor = "#FF4544",
ButtonFilletPX = 40, ButtonFilletPX = 40,
ButtonText = "申请成为分销商", ButtonText = "申请成为分销商",
ButtonTextColor = "#FFFFFF", ButtonTextColor = "#FFFFFF",
DistributionApplication = "分销申请", DistributionApplication = "分销申请",
DistributionCommissionName = "分销佣金", DistributionCommissionName = "分销佣金",
DistributionCommissionImage = 3, DistributionCommissionImage = Common.Config.GetFileUrl("/Upload/Set/1587968503000.png"),
DistributionOrderName = "分销订单", DistributionOrderName = "分销订单",
DistributionOrderImage = 4, DistributionOrderImage = Common.Config.GetFileUrl("/Upload/Set/1587968517000.png"),
WithdrawDetialsName = "提现明细", WithdrawDetialsName = "提现明细",
WithdrawDetialsImage = 5, WithdrawDetialsImage = Common.Config.GetFileUrl("/Upload/Set/1587968599000.png"),
MyTeamName = "我的团队", MyTeamName = "我的团队",
MyTeamImage = 6, MyTeamImage = Common.Config.GetFileUrl("/Upload/Set/1587968613000.png"),
PromoteQRCodeName = "推广二维码", PromoteQRCodeName = "推广二维码",
PromoteQRCodeImage = 7, PromoteQRCodeImage = Common.Config.GetFileUrl("/Upload/Set/1587968626000.png"),
ReferrerName = "推荐人", ReferrerName = "推荐人",
CommissionForWithdrawalName = "可提现佣金", CommissionForWithdrawalName = "可提现佣金",
WithdrawDepositName = "提现", WithdrawDepositName = "提现",
......
...@@ -23,7 +23,7 @@ namespace Mall.Repository.Product ...@@ -23,7 +23,7 @@ namespace Mall.Repository.Product
/// <returns></returns> /// <returns></returns>
public List<RB_Material_Info_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Material_Info_Extend dmodel) public List<RB_Material_Info_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Material_Info_Extend dmodel)
{ {
string where = $" 1=1 and Id>100 and {nameof(RB_Material_Info.Status)}=0"; string where = $" 1=1 and {nameof(RB_Material_Info.Status)}=0";
if (dmodel.Id >= 100) if (dmodel.Id >= 100)
{ {
if (dmodel.TenantId > 0) if (dmodel.TenantId > 0)
......
...@@ -16,6 +16,7 @@ using Mall.Model.Entity.User; ...@@ -16,6 +16,7 @@ using Mall.Model.Entity.User;
using Mall.Common; using Mall.Common;
using Mall.Model.Extend.User; using Mall.Model.Extend.User;
using NPOI.SS.Formula.Functions; using NPOI.SS.Formula.Functions;
using Org.BouncyCastle.Utilities.Net;
namespace Mall.WebApi.App_Code namespace Mall.WebApi.App_Code
{ {
...@@ -44,7 +45,7 @@ namespace Mall.WebApi.App_Code ...@@ -44,7 +45,7 @@ namespace Mall.WebApi.App_Code
/// <param name="CustomerId"></param> /// <param name="CustomerId"></param>
/// <param name="openid"></param> /// <param name="openid"></param>
/// <returns></returns> /// <returns></returns>
public static string GetMinUnifiedOrder(string sOrderNo, string sProductName, decimal dPrice, string CustomerId, string openid, RB_MiniProgram_Extend model, IHttpContextAccessor _accessor) public static string GetMinUnifiedOrder(string sOrderNo, string sProductName, decimal dPrice, string CustomerId, string openid, RB_MiniProgram_Extend model, IHttpContextAccessor _accessor,string IPAddress)
{ {
var req = new Common.Pay.WeChatPat.RequestHandler(); var req = new Common.Pay.WeChatPat.RequestHandler();
req.SetKey(model.WeChatApiSecret); req.SetKey(model.WeChatApiSecret);
...@@ -56,13 +57,13 @@ namespace Mall.WebApi.App_Code ...@@ -56,13 +57,13 @@ namespace Mall.WebApi.App_Code
req.SetParameter("attach", CustomerId); req.SetParameter("attach", CustomerId);
req.SetParameter("out_trade_no", sOrderNo); req.SetParameter("out_trade_no", sOrderNo);
req.SetParameter("total_fee", (dPrice * 100).ToString("f0")); req.SetParameter("total_fee", (dPrice * 100).ToString("f0"));
req.SetParameter("spbill_create_ip", _accessor.HttpContext.Connection.RemoteIpAddress.ToString()); req.SetParameter("spbill_create_ip",IPAddress);
req.SetParameter("time_start", DateTime.Now.ToString("yyyyMMddHHmmss")); req.SetParameter("time_start", DateTime.Now.ToString("yyyyMMddHHmmss"));
req.SetParameter("time_expire", DateTime.Now.AddMinutes(10).ToString("yyyyMMddHHmmss")); req.SetParameter("time_expire", DateTime.Now.AddMinutes(10).ToString("yyyyMMddHHmmss"));
req.SetParameter("notify_url", Config.sTenpayNotify); req.SetParameter("notify_url", Config.sTenpayNotify);
req.SetParameter("trade_type", "JSAPI"); req.SetParameter("trade_type", "JSAPI");
req.SetParameter("openid", openid); req.SetParameter("openid", openid);
req.SetParameter("sign", req.CreateMd5Sign(_accessor)); req.SetParameter("sign", req.CreateMd5Sign(_accessor, model.WeChatApiSecret));
var reqXml = req.ParseXml(); var reqXml = req.ParseXml();
var result = Common.Pay.WeChatPat.HttpHelper.Post(new HttpParam() var result = Common.Pay.WeChatPat.HttpHelper.Post(new HttpParam()
...@@ -77,12 +78,16 @@ namespace Mall.WebApi.App_Code ...@@ -77,12 +78,16 @@ namespace Mall.WebApi.App_Code
try try
{ {
var prepayId = xe.GetElement("return_code").Value; var prepayId = xe.GetElement("prepay_id").Value;
var payReq = new RequestHandler(); var payReq = new RequestHandler();
payReq.SetKey(model.WeChatApiSecret);
payReq.SetParameter("appId", model.MiniAppId); payReq.SetParameter("appId", model.MiniAppId);
payReq.SetParameter("timeStamp", GetTimestamp());
payReq.SetParameter("nonceStr", GetNoncestr());
payReq.SetParameter("package", "prepay_id=" + prepayId);
payReq.SetParameter("signType", "MD5");
//创建签名 //创建签名
payReq.SetParameter("sign", payReq.CreateMd5Sign(_accessor)); payReq.SetParameter("sign", payReq.CreateMd5Sign(_accessor, model.WeChatApiSecret));
var payReqXml = payReq.ParseXml(); var payReqXml = payReq.ParseXml();
var payReqJson = payReq.ParseJson(); var payReqJson = payReq.ParseJson();
return payReqJson; return payReqJson;
...@@ -217,7 +222,7 @@ namespace Mall.WebApi.App_Code ...@@ -217,7 +222,7 @@ namespace Mall.WebApi.App_Code
packageReq.SetParameter("out_refund_no", param.RefundNumber); packageReq.SetParameter("out_refund_no", param.RefundNumber);
packageReq.SetParameter("total_fee", (param.TotalFee.Value).ToString(System.Globalization.CultureInfo.InvariantCulture)); packageReq.SetParameter("total_fee", (param.TotalFee.Value).ToString(System.Globalization.CultureInfo.InvariantCulture));
packageReq.SetParameter("refund_fee", param.RefundFee.Value.ToString(System.Globalization.CultureInfo.InvariantCulture)); packageReq.SetParameter("refund_fee", param.RefundFee.Value.ToString(System.Globalization.CultureInfo.InvariantCulture));
packageReq.SetParameter("sign", packageReq.CreateMd5Sign(_accessor)); packageReq.SetParameter("sign", packageReq.CreateMd5Sign(_accessor, model.WeChatApiSecret));
var reqXml = packageReq.ParseXml(); var reqXml = packageReq.ParseXml();
var result = Common.Pay.WeChatPat.HttpHelper.Post(new HttpParam() var result = Common.Pay.WeChatPat.HttpHelper.Post(new HttpParam()
...@@ -277,7 +282,7 @@ namespace Mall.WebApi.App_Code ...@@ -277,7 +282,7 @@ namespace Mall.WebApi.App_Code
packageReq.SetParameter("appid", model.MiniAppId); packageReq.SetParameter("appid", model.MiniAppId);
packageReq.SetParameter("mch_id", model.WeChatPayMerchants); packageReq.SetParameter("mch_id", model.WeChatPayMerchants);
packageReq.SetParameter("nonce_str", GetNoncestr()); packageReq.SetParameter("nonce_str", GetNoncestr());
packageReq.SetParameter("sign", packageReq.CreateMd5Sign(_accessor)); packageReq.SetParameter("sign", packageReq.CreateMd5Sign(_accessor, model.WeChatApiSecret));
packageReq.SetParameter("out_refund_no", param.RefundNumber);//商户系统内部的退款单号 packageReq.SetParameter("out_refund_no", param.RefundNumber);//商户系统内部的退款单号
var reqXml = packageReq.ParseXml(); var reqXml = packageReq.ParseXml();
...@@ -362,7 +367,7 @@ namespace Mall.WebApi.App_Code ...@@ -362,7 +367,7 @@ namespace Mall.WebApi.App_Code
req.SetParameter("mch_appid", model.MiniAppId);//微信开放平台审核通过的应用APPID req.SetParameter("mch_appid", model.MiniAppId);//微信开放平台审核通过的应用APPID
req.SetParameter("mchid", model.WeChatPayMerchants);//微信支付分配的商户号 req.SetParameter("mchid", model.WeChatPayMerchants);//微信支付分配的商户号
req.SetParameter("nonce_str", GetNoncestr());//随机字符串,不长于32位 req.SetParameter("nonce_str", GetNoncestr());//随机字符串,不长于32位
req.SetParameter("sign", req.CreateMd5Sign(_accessor)); req.SetParameter("sign", req.CreateMd5Sign(_accessor, model.WeChatApiSecret));
req.SetParameter("partner_trade_no", sOrderNo);//商户订单号,需保持唯一性(只能是字母或者数字,不能包含有其它字符) req.SetParameter("partner_trade_no", sOrderNo);//商户订单号,需保持唯一性(只能是字母或者数字,不能包含有其它字符)
req.SetParameter("openid", openid); req.SetParameter("openid", openid);
req.SetParameter("check_name", "NO_CHECK"); req.SetParameter("check_name", "NO_CHECK");
......
...@@ -3,6 +3,7 @@ using System.Collections.Generic; ...@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Web; using System.Web;
using Google.Protobuf.WellKnownTypes;
using Mall.Common.API; using Mall.Common.API;
using Mall.Common.Pay.WeChatPat; using Mall.Common.Pay.WeChatPat;
using Mall.Common.Plugin; using Mall.Common.Plugin;
...@@ -14,12 +15,17 @@ using Newtonsoft.Json.Linq; ...@@ -14,12 +15,17 @@ using Newtonsoft.Json.Linq;
namespace Mall.WebApi.Controllers.AppletWeChat namespace Mall.WebApi.Controllers.AppletWeChat
{ {
[Route("api/[controller]/[action]")]
[ApiExceptionFilter]
[ApiController]
[EnableCors("AllowCors")]
public class WeChatNotifyController : Controller public class WeChatNotifyController : Controller
{ {
private static object _lock = new object(); private static object _lock = new object();
UserCommonModule userCommonModule = new UserCommonModule(); UserCommonModule userCommonModule = new UserCommonModule();
/// <summary> /// <summary>
/// 订单支付回调 /// 订单支付回调
/// </summary> /// </summary>
...@@ -52,9 +58,12 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -52,9 +58,12 @@ namespace Mall.WebApi.Controllers.AppletWeChat
userCommonModule.InsertOrderPayInfo(UserId, OrderId, sOrderNo, TransactionId, Common.Enum.Goods.OrderPayTypeEnum.WeChatPay, PayType, dPaid, PayDate, 0); userCommonModule.InsertOrderPayInfo(UserId, OrderId, sOrderNo, TransactionId, Common.Enum.Goods.OrderPayTypeEnum.WeChatPay, PayType, dPaid, PayDate, 0);
#endregion #endregion
} }
var reqXml = req.ParseXml();
//告诉微信我们已经处理成功,不需要再调用我们的接口了 //告诉微信我们已经处理成功,不需要再调用我们的接口了
req.SetParameter("return_code", "SUCCESS");
req.SetParameter("return_msg", "OK");
var reqXml = req.ParseXml();
return reqXml; return reqXml;
// return ApiResult.Success("", reqXml);
} }
else else
{ {
...@@ -63,6 +72,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -63,6 +72,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
var reqXmlFAIL = req.ParseXml(); var reqXmlFAIL = req.ParseXml();
LogHelper.Write(null, "Notify返回信息:" + reqXmlFAIL); LogHelper.Write(null, "Notify返回信息:" + reqXmlFAIL);
return reqXmlFAIL; return reqXmlFAIL;
// return ApiResult.Failed("", reqXmlFAIL);
} }
} }
} }
......
...@@ -92,8 +92,8 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -92,8 +92,8 @@ namespace Mall.WebApi.Controllers.AppletWeChat
App_Code.PayUtil payUtil = new App_Code.PayUtil(); App_Code.PayUtil payUtil = new App_Code.PayUtil();
switch ((int)demodel.OrderPayType) switch ((int)demodel.OrderPayType)
{ {
case 1://微信支付 case 1://微信支付 _accessor.HttpContext.Connection.RemoteIpAddress.ToString()
sPayInfo = App_Code.PayUtil.GetMinUnifiedOrder(sOrderNo, demodel.GoodsName, model.Income.Value, model.UserId.ToString(), demodel.OpenId, miniProgram, _accessor); sPayInfo = App_Code.PayUtil.GetMinUnifiedOrder(sOrderNo, demodel.GoodsName, model.Income.Value, model.UserId.ToString(), demodel.OpenId, miniProgram, _accessor, System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList.FirstOrDefault(address => address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)?.ToString());
break; break;
default: default:
break; break;
......
...@@ -1656,14 +1656,14 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1656,14 +1656,14 @@ namespace Mall.WebApi.Controllers.MallBase
icon_url = qitem.MenuIcon, icon_url = qitem.MenuIcon,
name = qitem.MenuName, name = qitem.MenuName,
is_show = 1, is_show = 1,
link_url = qitem.MenuUrl, link_url = qitem.MenuUrl.Trim(),
}), }),
//自定义菜单 //自定义菜单
menus = miniProgram?.SelfMenuList.Select(qitem => new menus = miniProgram?.SelfMenuList.Select(qitem => new
{ {
icon_url = qitem.MenuIcon, icon_url = qitem.MenuIcon,
name = qitem.MenuName, name = qitem.MenuName,
link_url = qitem.MenuUrl, link_url = qitem.MenuUrl.Trim(),
open_type = "navigate", open_type = "navigate",
@params = "", @params = "",
...@@ -1673,7 +1673,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1673,7 +1673,7 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
icon_url = qitem.MenuIcon, icon_url = qitem.MenuIcon,
name = qitem.MenuName, name = qitem.MenuName,
link_url = qitem.MenuUrl, link_url = qitem.MenuUrl.Trim(),
open_type = "navigate", open_type = "navigate",
text = "", text = "",
}), }),
...@@ -1682,7 +1682,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1682,7 +1682,7 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
icon_url = qitem.MenuIcon, icon_url = qitem.MenuIcon,
name = qitem.MenuName, name = qitem.MenuName,
link_url = qitem.MenuUrl, link_url = qitem.MenuUrl.Trim(),
open_type = "navigate", open_type = "navigate",
}), }),
//版权设置 //版权设置
...@@ -1690,7 +1690,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1690,7 +1690,7 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
pic_url = miniProgram.CopyRightImg, pic_url = miniProgram.CopyRightImg,
description = miniProgram.CopyRightWord, description = miniProgram.CopyRightWord,
link_url = miniProgram.CopyRightLink, link_url = miniProgram.CopyRightLink.Trim(),
} }
} }
}; };
......
...@@ -874,11 +874,11 @@ namespace Mall.WebApi.Controllers.User ...@@ -874,11 +874,11 @@ namespace Mall.WebApi.Controllers.User
{ {
var requestParm = RequestParm; var requestParm = RequestParm;
RB_Distributor_Custom_Extend demodel = JsonConvert.DeserializeObject<RB_Distributor_Custom_Extend>(requestParm.msg.ToString()); RB_Distributor_Custom_Extend demodel = JsonConvert.DeserializeObject<RB_Distributor_Custom_Extend>(requestParm.msg.ToString());
if ((demodel.HeadImage ?? 0) <= 0) if (demodel.HeadImage==null ||string.IsNullOrWhiteSpace(demodel.HeadImage))
{ {
return ApiResult.ParamIsNull("请传递分销申请下头部图片"); return ApiResult.ParamIsNull("请传递分销申请下头部图片");
} }
if ((demodel.BottomImage ?? 0) <= 0) if (demodel.BottomImage == null || string.IsNullOrWhiteSpace(demodel.BottomImage))
{ {
return ApiResult.ParamIsNull("请传递分销申请下底部图片"); return ApiResult.ParamIsNull("请传递分销申请下底部图片");
} }
...@@ -890,10 +890,6 @@ namespace Mall.WebApi.Controllers.User ...@@ -890,10 +890,6 @@ namespace Mall.WebApi.Controllers.User
{ {
return ApiResult.ParamIsNull("请传递分销申请下分销申请协议"); return ApiResult.ParamIsNull("请传递分销申请下分销申请协议");
} }
if ((demodel.BottomImage ?? 0) <= 0)
{
return ApiResult.ParamIsNull("请传递分销申请下按钮圆角像素");
}
if (string.IsNullOrEmpty(demodel.ButtonText)) if (string.IsNullOrEmpty(demodel.ButtonText))
{ {
return ApiResult.ParamIsNull("请传递分销申请下按钮文本"); return ApiResult.ParamIsNull("请传递分销申请下按钮文本");
...@@ -911,7 +907,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -911,7 +907,7 @@ namespace Mall.WebApi.Controllers.User
{ {
return ApiResult.ParamIsNull("请传递分销中心下分销佣金"); return ApiResult.ParamIsNull("请传递分销中心下分销佣金");
} }
if ((demodel.DistributionCommissionImage ?? 0) <= 0) if (demodel.DistributionCommissionImage==null || string.IsNullOrWhiteSpace(demodel.DistributionCommissionImage))
{ {
return ApiResult.ParamIsNull("请传递分销中心下分销佣金图片"); return ApiResult.ParamIsNull("请传递分销中心下分销佣金图片");
} }
...@@ -919,7 +915,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -919,7 +915,7 @@ namespace Mall.WebApi.Controllers.User
{ {
return ApiResult.ParamIsNull("请传递分销中心下分销订单"); return ApiResult.ParamIsNull("请传递分销中心下分销订单");
} }
if ((demodel.DistributionOrderImage ?? 0) <= 0) if (demodel.DistributionOrderImage==null ||string.IsNullOrWhiteSpace(demodel.DistributionOrderImage))
{ {
return ApiResult.ParamIsNull("请传递分销中心下分销订单图片"); return ApiResult.ParamIsNull("请传递分销中心下分销订单图片");
} }
...@@ -927,7 +923,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -927,7 +923,7 @@ namespace Mall.WebApi.Controllers.User
{ {
return ApiResult.ParamIsNull("请传递分销中心下提现明细"); return ApiResult.ParamIsNull("请传递分销中心下提现明细");
} }
if ((demodel.WithdrawDetialsImage ?? 0) <= 0) if (demodel.WithdrawDetialsImage==null || string.IsNullOrWhiteSpace(demodel.WithdrawDetialsImage))
{ {
return ApiResult.ParamIsNull("请传递分销中心下提现明细图片"); return ApiResult.ParamIsNull("请传递分销中心下提现明细图片");
} }
...@@ -935,7 +931,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -935,7 +931,7 @@ namespace Mall.WebApi.Controllers.User
{ {
return ApiResult.ParamIsNull("请传递分销中心下我的团队"); return ApiResult.ParamIsNull("请传递分销中心下我的团队");
} }
if ((demodel.MyTeamImage ?? 0) <= 0) if (demodel.MyTeamImage==null ||string.IsNullOrWhiteSpace(demodel.MyTeamImage))
{ {
return ApiResult.ParamIsNull("请传递分销中心下我的团队图片"); return ApiResult.ParamIsNull("请传递分销中心下我的团队图片");
} }
...@@ -943,7 +939,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -943,7 +939,7 @@ namespace Mall.WebApi.Controllers.User
{ {
return ApiResult.ParamIsNull("请传递分销中心下推广二维码"); return ApiResult.ParamIsNull("请传递分销中心下推广二维码");
} }
if ((demodel.PromoteQRCodeImage ?? 0) <= 0) if (demodel.PromoteQRCodeImage==null ||string.IsNullOrWhiteSpace(demodel.PromoteQRCodeImage))
{ {
return ApiResult.ParamIsNull("请传递分销中心下推广二维码图片"); return ApiResult.ParamIsNull("请传递分销中心下推广二维码图片");
} }
......
...@@ -55,7 +55,7 @@ namespace Test.Helper ...@@ -55,7 +55,7 @@ namespace Test.Helper
{ {
} }
int pageIndex = 0; int pageIndex = 1;
int pageCount = 1; int pageCount = 1;
List<CategoryImg> imgList = new List<CategoryImg>(); List<CategoryImg> imgList = new List<CategoryImg>();
while (pageIndex <= pageCount) while (pageIndex <= pageCount)
...@@ -155,7 +155,7 @@ namespace Test.Helper ...@@ -155,7 +155,7 @@ namespace Test.Helper
list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<CategoryImg>>(dataObj["list"].ToString()); list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<CategoryImg>>(dataObj["list"].ToString());
var pageObj = JObject.Parse(dataObj["pagination"].ToString()); var pageObj = JObject.Parse(dataObj["pagination"].ToString());
Int32.TryParse(pageObj["total_count"].ToString(), out pageCount); Int32.TryParse(pageObj["page_count"].ToString(), out pageCount);
} }
return list; return list;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment