Commit ee8554b5 authored by 王源's avatar 王源 🎧

Merge branch 'test'

parents 6e4ceb54 c3f68159
...@@ -40,6 +40,7 @@ class Drawer ...@@ -40,6 +40,7 @@ class Drawer
} }
/** /**
* 下载网络图片
* @param string $url * @param string $url
* @param string $path * @param string $path
* @return string * @return string
...@@ -81,10 +82,19 @@ class Drawer ...@@ -81,10 +82,19 @@ class Drawer
$url = str_replace("%2F", "/", $url); $url = str_replace("%2F", "/", $url);
$url = str_replace("%3F", "?", $url); $url = str_replace("%3F", "?", $url);
$url = str_replace("%3D", "=", $url); $url = str_replace("%3D", "=", $url);
$url = str_replace("%26", "&", $url);
} }
return $url; return $this->handleOssUrl($url);
} }
// 替换阿里云图片内部地址
private function handleOssUrl($url)
{
if ($this->config->get('app_env') !== 'dev') {
$url = str_replace('oss-cn-hangzhou.aliyuncs.com', 'oss-accelerate.aliyuncs.com', $url);
}
return $url;
}
/** /**
* description:下载文件到服务端 增加判断是否是webp 格式的图片处理 * description:下载文件到服务端 增加判断是否是webp 格式的图片处理
......
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