Explorar el Código

使用物流公司获取电子面单模版接口优化

evoxwht hace 2 años
padre
commit
bb69a26eff

+ 7 - 2
crmeb/crmeb/services/HttpService.php

@@ -88,8 +88,13 @@ class HttpService
         $method = strtoupper($method);
         $method = strtoupper($method);
         //请求方式
         //请求方式
         curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
         curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
-        //post请求
-        if ($method == 'POST') curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
+        //携带参数
+        if ($method == 'POST') {
+            curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
+        } elseif ($method == 'GET' && count($data)) {
+            $url .= '?' . http_build_query($data);
+            curl_setopt($curl, CURLOPT_URL, $url);
+        }
         //超时时间
         //超时时间
         curl_setopt($curl, CURLOPT_TIMEOUT, $timeout);
         curl_setopt($curl, CURLOPT_TIMEOUT, $timeout);
         //设置header头
         //设置header头

+ 1 - 1
crmeb/crmeb/services/express/storage/Express.php

@@ -30,7 +30,7 @@ class Express extends BaseExpress
     /**
     /**
      * 电子面单模版
      * 电子面单模版
      */
      */
-    const EXPRESS_TEMP = 'v2/expr/temp';
+    const EXPRESS_TEMP = 'v2/expr_dump/temp';
 
 
     /**
     /**
      * 快递公司
      * 快递公司