From 769eb4bbd50f9453a782cbcfd7e7c81dccf5bfaa Mon Sep 17 00:00:00 2001 From: Wisp X <1591788658@qq.com> Date: Tue, 22 Mar 2022 14:17:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Requests/Admin/StrategyRequest.php | 2 +- app/Models/Image.php | 2 +- config/app.php | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/Http/Requests/Admin/StrategyRequest.php b/app/Http/Requests/Admin/StrategyRequest.php index 1f887279f..8b542b86a 100644 --- a/app/Http/Requests/Admin/StrategyRequest.php +++ b/app/Http/Requests/Admin/StrategyRequest.php @@ -18,7 +18,7 @@ public function rules() { $checkUrl = function ($attribute, $value, $fail) { if ($this->input('key') == StrategyKey::Local) { - $folders = [env('THUMBNAIL_PATH', 'thumbnails'), 'fonts', 'css', 'js']; + $folders = [config('app.thumbnail_path'), 'fonts', 'css', 'js']; $symlink = Strategy::getRootPath($value); if (! $symlink) { return $fail('访问域名缺少根路径'); diff --git a/app/Models/Image.php b/app/Models/Image.php index d252452f9..194f35d6a 100644 --- a/app/Models/Image.php +++ b/app/Models/Image.php @@ -235,7 +235,7 @@ public function strategy(): BelongsTo public function getThumbnailPathname(): string { - return trim(env('THUMBNAIL_PATH', 'thumbnails'), '/')."/{$this->md5}.png"; + return trim(config('app.thumbnail_path'), '/')."/{$this->md5}.png"; } private function generateKey($length = 6): string diff --git a/config/app.php b/config/app.php index e67daa240..9ada001a1 100644 --- a/config/app.php +++ b/config/app.php @@ -194,4 +194,11 @@ // ... ])->toArray(), + /* + |-------------------------------------------------------------------------- + | Lsky configs + |-------------------------------------------------------------------------- + */ + + 'thumbnail_path' => env('THUMBNAIL_PATH', 'thumbnails') ];