|
|
|
@ -252,7 +252,7 @@ class Base |
|
|
|
if (empty($url)) return ['status' => 0, 'msg' => 'url不能为空']; |
|
|
|
# 获取请求路径 |
|
|
|
if (empty($host_path)) { |
|
|
|
$config = config('api_config'); |
|
|
|
$config = $this->config('api_config'); |
|
|
|
$host_path = $config['host_path']; |
|
|
|
} |
|
|
|
# 验证令牌 |
|
|
|
@ -260,10 +260,10 @@ class Base |
|
|
|
# 请求接口数据 |
|
|
|
$data = [ |
|
|
|
'data' => $encrypt ? json_encode($requestData) : base64_encode(json_encode($requestData)), |
|
|
|
'token' => md5($token . date('Ymd')) |
|
|
|
'encrypt' => $encrypt ? 1 : 0 |
|
|
|
]; |
|
|
|
$date = (int)date("d"); |
|
|
|
$date['signature'] = md5($token . ($date % 2) . md5($data['data'])); |
|
|
|
$data['signature'] = md5($token . ($date % 2) . md5($data['data'])); |
|
|
|
$json_data = json_encode($data); |
|
|
|
$createUrl = $host_path . $url; |
|
|
|
# 发起请求 |
|
|
|
|