From 4b7d34fc4f86f8b06f4f6c8a1ee9d530df77a04b Mon Sep 17 00:00:00 2001 From: WispX <1591788658@qq.com> Date: Wed, 8 Jan 2020 11:08:44 +0800 Subject: [PATCH] :arrow_up: Upgrading dependencies. --- .env.example | 3 +++ application/index/controller/Upload.php | 27 +++++++++---------------- application/index/view/index/index.html | 8 -------- config/naming.php | 12 ----------- config/site.php | 2 +- 5 files changed, 13 insertions(+), 39 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..917da860 --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +[app] +debug = false +trace = false diff --git a/application/index/controller/Upload.php b/application/index/controller/Upload.php index abce7c8b..60485bcb 100755 --- a/application/index/controller/Upload.php +++ b/application/index/controller/Upload.php @@ -209,29 +209,20 @@ class Upload extends Base $naming = Config::pull('naming'); $pathRule = $this->config['path_naming_rule']; $fileRule = $this->config['file_naming_rule']; - - if ($pathRule === '{input}') { - $path = trim(input('album'), '/'); - } elseif ($pathRule === '{input_with_user}') { - $path = trim($this->user->username . '/' . input('album'), '/'); - } else { - $path = trim(str_replace( - array_column($naming['path'], 'name'), - array_column($naming['path'], 'value'), - $pathRule - ), '/'); - } - + $path = trim(str_replace( + array_column($naming['path'], 'name'), + array_column($naming['path'], 'value'), + $pathRule + ), '/'); if ($fileRule === '{original}') { $file = $name; } else { $file = trim(str_replace( - array_column($naming['file'], 'name'), - array_column($naming['file'], 'value'), - $fileRule - ), '/') . '.' . get_file_ext($name); + array_column($naming['file'], 'name'), + array_column($naming['file'], 'value'), + $fileRule + ), '/') . '.' . get_file_ext($name); } - return $path . '/' . $file; } } diff --git a/application/index/view/index/index.html b/application/index/view/index/index.html index e78c5920..1209cc3f 100755 --- a/application/index/view/index/index.html +++ b/application/index/view/index/index.html @@ -24,8 +24,6 @@