!286 京东打印
Merge pull request !286 from 杨建炊/fix-release-1.0.0/yjc-migrate
This commit is contained in:
commit
66320bdfcd
@ -155,14 +155,14 @@ abstract class BusinessClient
|
|||||||
'headers' => ['Content-type' => 'application/x-www-form-urlencoded;charset=UTF-8'],
|
'headers' => ['Content-type' => 'application/x-www-form-urlencoded;charset=UTF-8'],
|
||||||
'form_params' => $params
|
'form_params' => $params
|
||||||
];
|
];
|
||||||
$res = (new Client(['verify'=>false]))->request($method, $url, $headers);
|
$res = (new Client(['verify' => false]))->request($method, $url, $headers);
|
||||||
$size = $res->getBody()->getSize();
|
$size = $res->getBody()->getSize();
|
||||||
$res = json_decode($res->getBody()->getContents(), true);
|
$res = json_decode($res->getBody()->getContents(), true);
|
||||||
$paramsJson = json_encode($params, 256);
|
$paramsJson = json_encode($params, 256);
|
||||||
if (strlen($paramsJson) > 1024) {
|
if (strlen($paramsJson) > 1024) {
|
||||||
$paramsJson = '';
|
$paramsJson = '';
|
||||||
}
|
}
|
||||||
if (!in_array($params['type'], ['pdd.ktt.increment.order.query', 'pdd.ktt.order.list',"pdd.ktt.after.sales.increment.list","pdd.ktt.order.get"], true)) {
|
if (!in_array($params['type'], ['pdd.ktt.increment.order.query', 'pdd.ktt.order.list', "pdd.ktt.after.sales.increment.list", "pdd.ktt.order.get"], true)) {
|
||||||
$log = new Log();
|
$log = new Log();
|
||||||
$log->module = 'plat';
|
$log->module = 'plat';
|
||||||
$log->action = $method;
|
$log->action = $method;
|
||||||
@ -177,7 +177,7 @@ abstract class BusinessClient
|
|||||||
}
|
}
|
||||||
$log->save();
|
$log->save();
|
||||||
}
|
}
|
||||||
if (in_array($params['type'], ['pdd.ktt.increment.order.query', 'pdd.ktt.order.list',"pdd.ktt.after.sales.increment.list"], true)) {
|
if (in_array($params['type'], ['pdd.ktt.increment.order.query', 'pdd.ktt.order.list', "pdd.ktt.after.sales.increment.list"], true)) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,14 +191,19 @@ abstract class BusinessClient
|
|||||||
foreach ($batchParams as $param) {
|
foreach ($batchParams as $param) {
|
||||||
$options = [
|
$options = [
|
||||||
'headers' => ['Content-type' => 'application/x-www-form-urlencoded;'],
|
'headers' => ['Content-type' => 'application/x-www-form-urlencoded;'],
|
||||||
'form_params' => $param
|
'form_params' => $param,
|
||||||
|
"timeout" => 5
|
||||||
];
|
];
|
||||||
\Illuminate\Support\Facades\Log::info("请求参数",[$options,time()]);
|
\Illuminate\Support\Facades\Log::info("快团团请求参数", [$options, time()]);
|
||||||
$promises[] = $client->postAsync($url, $options);
|
$promises[] = $client->postAsync($url, $options);
|
||||||
}
|
}
|
||||||
if ($promises) {
|
if ($promises) {
|
||||||
Promise\Utils::unwrap($promises);
|
try {
|
||||||
|
Promise\Utils::unwrap($promises);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
\Illuminate\Support\Facades\Log::error("快团团请求过程中出现错误: " . $e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
\Illuminate\Support\Facades\Log::info("请求结束",[time()]);
|
\Illuminate\Support\Facades\Log::info("快团团请求结束", [time()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user