pull/1121/head
梁宇奇 2025-08-19 17:00:10 +08:00
parent 37adf3c384
commit a8282d903e
1 changed files with 4 additions and 0 deletions

View File

@ -46,6 +46,10 @@ public class Kuaidi100Client {
String fullUrl = StrUtil.indexedFormat(url, waybillNum, key);
HttpRequest httpRequest = HttpUtil.createGet(fullUrl);
String result = httpRequest.execute().body();
if (result.startsWith("{")) {
//{"returnCode":"201","message":"不是有效的快递单号","result":false}
return null;
}
JSONArray array = JSON.parseArray(result);
if (!array.isEmpty()) {
return array.getJSONObject(0).getString("comCode");