diff --git a/app/Http/Requests/Admin/StrategyRequest.php b/app/Http/Requests/Admin/StrategyRequest.php index 1f887279..8b542b86 100644 --- a/app/Http/Requests/Admin/StrategyRequest.php +++ b/app/Http/Requests/Admin/StrategyRequest.php @@ -18,7 +18,7 @@ class StrategyRequest extends FormRequest { $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 d252452f..194f35d6 100644 --- a/app/Models/Image.php +++ b/app/Models/Image.php @@ -235,7 +235,7 @@ class Image extends Model 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 e67daa24..9ada001a 100644 --- a/config/app.php +++ b/config/app.php @@ -194,4 +194,11 @@ return [ // ... ])->toArray(), + /* + |-------------------------------------------------------------------------- + | Lsky configs + |-------------------------------------------------------------------------- + */ + + 'thumbnail_path' => env('THUMBNAIL_PATH', 'thumbnails') ];