Commit f381fbb1 authored by fuyunnan's avatar fuyunnan

将curl 源改成 去掉版本号之前的

parent 8768b234
...@@ -107,6 +107,7 @@ class Drawer ...@@ -107,6 +107,7 @@ class Drawer
*/ */
public function downLoadImgWebpChannel($url, $path = '') public function downLoadImgWebpChannel($url, $path = '')
{ {
$originUrl = $url;
//如果shopify 去掉版本号 //如果shopify 去掉版本号
if (strpos($url, 'shopify') !== false) { if (strpos($url, 'shopify') !== false) {
$url = substr($url, 0, strpos($url, '?v=')); $url = substr($url, 0, strpos($url, '?v='));
...@@ -120,7 +121,7 @@ class Drawer ...@@ -120,7 +121,7 @@ class Drawer
$filePath = $savePath . "$filename.$ext"; $filePath = $savePath . "$filename.$ext";
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 信任任何证书 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 信任任何证书
curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_URL, $originUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
$file = curl_exec($ch); $file = curl_exec($ch);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment