From 27273629021ae0e6cce6ea222762d86f3983d900 Mon Sep 17 00:00:00 2001 From: devil Date: Sun, 23 Aug 2020 20:49:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=84=E4=BB=B6url=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/service/ResourcesService.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/application/service/ResourcesService.php b/application/service/ResourcesService.php index a8f6e27d7..20bd6134c 100755 --- a/application/service/ResourcesService.php +++ b/application/service/ResourcesService.php @@ -73,7 +73,17 @@ class ResourcesService */ public static function AttachmentPathHandle($value) { - return empty($value) ? '' : str_replace([__MY_PUBLIC_URL__, __MY_ROOT_PUBLIC__], DS, $value); + // 配置文件附件url地址 + $attachment_host = config('shopxo.attachment_host'); + $attachment_host_path = empty($attachment_host) ? __MY_PUBLIC_URL__ : $attachment_host.DS; + + // 替换处理 + $search = [ + __MY_PUBLIC_URL__, + __MY_ROOT_PUBLIC__, + $attachment_host_path, + ]; + return empty($value) ? '' : str_replace($search, DS, $value); } /**