Skip to content

Commit

Permalink
改进
Browse files Browse the repository at this point in the history
  • Loading branch information
wisp-x committed Mar 22, 2022
1 parent 10921b3 commit 769eb4b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Http/Requests/Admin/StrategyRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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('访问域名缺少根路径');
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,11 @@
// ...
])->toArray(),

/*
|--------------------------------------------------------------------------
| Lsky configs
|--------------------------------------------------------------------------
*/

'thumbnail_path' => env('THUMBNAIL_PATH', 'thumbnails')
];

0 comments on commit 769eb4b

Please sign in to comment.