diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs index 8b23f19f..e64c4ffc 100644 --- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs @@ -427,6 +427,11 @@ namespace BBWY.Server.Business if (platformRequest.SaveResponseLog) nLogManager.Default().Info(response.Body); + if (!string.IsNullOrEmpty(response.ErrorMsg) && response.ErrorMsg.Contains("token已过期")) + throw new BusinessException($"查询客服组失败-服务应用到期或未订购,请订购后进行授权\r\n订购链接:https://fw.jd.com/main/detail/FW_GOODS-187201"); + if (!string.IsNullOrEmpty(response.ErrMsg) && response.ErrMsg.Contains("token已过期")) + throw new BusinessException($"查询客服组失败-服务应用到期或未订购,请订购后进行授权\r\n订购链接:https://fw.jd.com/main/detail/FW_GOODS-187201"); + var jarray = (JArray)(response.Json["jingdong_fce_alpha_getVenderCarrier_responce"]["StandardGenericResponse"]["result"]["carrierList"]); return jarray.Select(j => new LogisticsResponse() @@ -1374,7 +1379,15 @@ namespace BBWY.Server.Business var req = new ImPopGroupinfoGetRequest(); var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime()); if (res.IsError) + { + if (!string.IsNullOrEmpty(res.ErrorMsg) && res.ErrorMsg.Contains("token已过期")) + throw new BusinessException($"查询客服组失败-服务应用到期或未订购,请订购后进行授权\r\n订购链接:https://fw.jd.com/main/detail/FW_GOODS-187201"); + if (!string.IsNullOrEmpty(res.ErrMsg) && res.ErrMsg.Contains("token已过期")) + throw new BusinessException($"查询客服组失败-服务应用到期或未订购,请订购后进行授权\r\n订购链接:https://fw.jd.com/main/detail/FW_GOODS-187201"); + throw new BusinessException($"查询客服组失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}"); + } + if (res.Json == null) res.Json = JsonConvert.DeserializeObject(res.Body); return res.Json["jingdong_im_pop_groupinfo_get_responce"]["popgroup"]["waiterList"].Select(j => new WaiterResponse()