mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-06 01:52:48 +08:00
开始实现使用内部的上传逻辑;
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
use app\common\service\AuthService;
|
||||
use think\facade\Cache;
|
||||
use think\facade\Request;
|
||||
use think\route\Url;
|
||||
|
||||
if (!function_exists('__url')) {
|
||||
@@ -219,3 +220,28 @@ if (!function_exists('unparse_url')) {
|
||||
return "$scheme$user$pass$host$port$path$query$fragment";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function build_upload_url($url)
|
||||
{
|
||||
$config = sysconfig('upload');
|
||||
|
||||
|
||||
$upload_type = $config['upload_type'] ?? 'local_public';
|
||||
|
||||
$prefix_url = '';
|
||||
|
||||
switch ($upload_type) {
|
||||
case 'local_public':
|
||||
$prefix_url = Request::domain();
|
||||
break;
|
||||
case 'qnoss':
|
||||
$prefix_url = $config['qnoss_domain'];
|
||||
break;
|
||||
|
||||
default:
|
||||
# code...
|
||||
break;
|
||||
}
|
||||
return trim($prefix_url, '/') . '/' . trim($url, '/');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user