diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs index 71e6f2ab..78370a6a 100644 --- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs @@ -132,20 +132,12 @@ namespace BBWY.Server.Business if (rep_skuList.IsError) throw new BusinessException(string.IsNullOrEmpty(rep_skuList.ErrorMsg) ? rep_skuList.ErrMsg : rep_skuList.ErrorMsg); - if (rep_skuList.Json == null || - !rep_skuList.Json.ContainsKey("jingdong_sku_read_searchSkuList_responce") || - rep_skuList.Json["jingdong_sku_read_searchSkuList_responce"]["page"] == null || - rep_skuList.Json["jingdong_sku_read_searchSkuList_responce"]["page"]["data"] == null) - { - return new ProductSkuResponse[0]; - } - return ((JArray)rep_skuList.Json["jingdong_sku_read_searchSkuList_responce"]["page"]["data"]).Select(s => new ProductSkuResponse() { Id = s.Value("skuId"), ProductId = s.Value("wareId"), Price = s.Value("jdPrice"), - Title = string.Join("-", s["saleAttrs"].Select(a => a["attrValueAlias"][0].ToString())), + Title = s["saleAttrs"] != null ? string.Join("-", s["saleAttrs"].Select(a => a["attrValueAlias"][0].ToString())) : string.Empty, Logo = $"https://img13.360buyimg.com/n9/s80x80_{s.Value("logo")}", State = s.Value("status"), CreateTime = s.Value("created").StampToDateTime()