From bcb568f2a9026e0d4bcba406f87d2a029bfdc815 Mon Sep 17 00:00:00 2001 From: liweisen Date: Tue, 24 Nov 2020 13:53:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/project/controller/File.php | 11 ++++++++--- config/database.php | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/application/project/controller/File.php b/application/project/controller/File.php index 2698396..f98ce49 100644 --- a/application/project/controller/File.php +++ b/application/project/controller/File.php @@ -6,6 +6,7 @@ use app\common\Model\Member; use controller\BasicApi; use service\FileService; use think\Exception; +use think\facade\Log; use think\facade\Request; @@ -116,11 +117,15 @@ class File extends BasicApi $ext = explode('.', $orgFileName); $ext = $ext[count($ext) - 1]; $fileUrl = "{$path}/{$fileName}-{$i}.{$ext}"; + +// logRecord(['url' => $fileUrl], 'info', 'temp/uploadFiles'); $site_url = FileService::getFileUrl($fileUrl, 'local'); - $blob = file_get_contents($site_url); + if ($site_url) { + $blob = file_get_contents($site_url); // $blob .= file_get_contents($site_url); - $fileList[] = env('root_path') . $fileUrl; - $result = FileService::$type($path2, $blob, true); + $fileList[] = env('root_path') . $fileUrl; + $result = FileService::$type($path2, $blob, true); + } unset($blob); unset($site_url); unset($fileUrl); diff --git a/config/database.php b/config/database.php index 4c47229..1787798 100644 --- a/config/database.php +++ b/config/database.php @@ -49,7 +49,7 @@ return [ // Query类 'query' => '\\think\\db\\Query', // 是否需要断线重连 - 'break_reconnect' => false, + 'break_reconnect' => true, // 断线标识字符串 'break_match_str' => [], ];