|
|
|
@ -51,13 +51,14 @@ class YjlyClient
|
|
|
|
|
return $this->request($api, $params);
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
$env = C('APP_ENV', null, 'prod');
|
|
|
|
|
Log::error('Yjzx ' . $e->getMessage());
|
|
|
|
|
Log::error('Yjly ' . $e->getMessage());
|
|
|
|
|
return ['status' => 0, 'msg' => '接口请求错误。' . ($env == 'prod' ? '' : $e->getMessage()) , 'data' => []];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function request($api, $params)
|
|
|
|
|
{
|
|
|
|
|
Log::info('Yjly-params: ' . json_encode($params));
|
|
|
|
|
if ($api['method'] == 'get') {
|
|
|
|
|
return $this->get($api['uri'], $params);
|
|
|
|
|
} else {
|
|
|
|
@ -72,7 +73,7 @@ class YjlyClient
|
|
|
|
|
'form_params' => $params,
|
|
|
|
|
]);
|
|
|
|
|
$result = (string)$response->getBody();
|
|
|
|
|
Log::info('Yjzx ' . json_encode($params) . ' ' . $result);
|
|
|
|
|
Log::info('Yjly-response: ' . $result);
|
|
|
|
|
return json_decode($result, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -83,7 +84,7 @@ class YjlyClient
|
|
|
|
|
'query' => $params,
|
|
|
|
|
]);
|
|
|
|
|
$result = (string)$response->getBody();
|
|
|
|
|
Log::info('Yjzx ' . json_encode($params) . ' ' . $result);
|
|
|
|
|
Log::info('Yjly-response: ' . $result);
|
|
|
|
|
return json_decode($result, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -104,6 +105,7 @@ class YjlyClient
|
|
|
|
|
$signString .= $params['orderNum'];
|
|
|
|
|
$signString .= $params['time'];
|
|
|
|
|
$signString .= self::SIGN_KEY;
|
|
|
|
|
Log::info('Yjly-signString: ' . $signString);
|
|
|
|
|
return md5($signString);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|