From 2f3c50d7463bc057a9ab3af9ed0f18d3ba30d9f2 Mon Sep 17 00:00:00 2001 From: wispx <1591788658@qq.com> Date: Wed, 6 Mar 2019 10:56:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AD=96=E7=95=A5=E7=BB=84?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=97=A0=E6=95=88=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Upload.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/application/index/controller/Upload.php b/application/index/controller/Upload.php index 557a3f7c..af762854 100644 --- a/application/index/controller/Upload.php +++ b/application/index/controller/Upload.php @@ -67,9 +67,10 @@ class Upload extends Base } // 当前储存策略 - $currentStrategy = strtolower($this->config['storage_strategy']); + $currentStrategy = strtolower($this->group->strategy); // 获取当前储存策略配置 $strategyConfig = $this->currentStrategyConfig; + // 获取当前驱动实例 $strategy = $this->getStrategyInstance(); @@ -147,10 +148,15 @@ class Upload extends Base $data = [ 'name' => $image->getInfo('name'), 'url' => $url, + 'size' => $size, + 'mime' => $mime, + 'sha1' => $sha1, + 'md5' => $md5, ]; + if ($this->user) { - $data['quota'] = sprintf('%.2f', (float) $user->quota); - $data['use_quota'] = sprintf('%.2f', (float) $user->use_quota); + $data['quota'] = sprintf('%.2f', (float)$user->quota); + $data['use_quota'] = sprintf('%.2f', (float)$user->use_quota); } return $data; @@ -199,10 +205,10 @@ class Upload extends Base ), '/'); $file = trim(str_replace( - array_column($naming['file'], 'name'), - array_column($naming['file'], 'value'), - $this->config['file_naming_rule'] - ), '/') . '.' . get_file_ext($name); + array_column($naming['file'], 'name'), + array_column($naming['file'], 'value'), + $this->config['file_naming_rule'] + ), '/') . '.' . get_file_ext($name); return $path . '/' . $file; }