上传公共方法

This commit is contained in:
liaofei 2019-12-23 14:54:12 +08:00
parent be295236f2
commit b7dd341b43

View File

@ -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;
}
}