From b7dd341b43d995b616cc444e16e05c6bf4b18d20 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Mon, 23 Dec 2019 14:54:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=85=AC=E5=85=B1=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/common.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/crmeb/app/common.php b/crmeb/app/common.php index 6f86dac9..d81fc761 100644 --- a/crmeb/app/common.php +++ b/crmeb/app/common.php @@ -177,4 +177,20 @@ if (!function_exists('sys_data')) { { return app('sysGroupData')->getData($name); } +} + +if (!function_exists('set_file_url')) { + /** + * 设置附加路径 + * @param $url + * @return bool + */ + function set_file_url($image, $siteUrl = '') + { + if (!strlen(trim($siteUrl))) $siteUrl = sys_config('site_url'); + $domainTop = substr($image, 0, 4); + if ($domainTop == 'http') return $image; + $image = str_replace('\\', '/', $image); + return $siteUrl . $image; + } } \ No newline at end of file