mirror of
https://github.com/lsky-org/lsky-pro.git
synced 2025-01-07 03:16:46 +08:00
🐛 修复 BUG
This commit is contained in:
parent
0e8ac365a5
commit
d8ee38573b
@ -26,7 +26,7 @@ use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
use Intervention\Image\Facades\Image as InterventionImage;
|
||||
use Intervention\Image\Gd\Font;
|
||||
use Intervention\Image\Imagick\Font;
|
||||
use Intervention\Image\ImageManager;
|
||||
use League\Flysystem\Filesystem;
|
||||
use League\Flysystem\FilesystemAdapter;
|
||||
|
@ -15,6 +15,5 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'gd'
|
||||
|
||||
'driver' => 'imagick'
|
||||
];
|
||||
|
@ -80,7 +80,7 @@ class DatabaseSeeder extends Seeder
|
||||
GroupConfigKey::LimitPerDay => 300,
|
||||
GroupConfigKey::LimitPerWeek => 600,
|
||||
GroupConfigKey::LimitPerMonth => 999,
|
||||
GroupConfigKey::AcceptedFileSuffixes => ['jpg', 'jpeg', 'gif', 'png', 'apng', 'bmp', 'ico'],
|
||||
GroupConfigKey::AcceptedFileSuffixes => ['jpeg', 'png', 'gif', 'tif', 'bmp', 'ico', 'psd', 'webp'],
|
||||
GroupConfigKey::PathNamingRule => '{Y}/{m}/{d}',
|
||||
GroupConfigKey::FileNamingRule => '{uniqid}',
|
||||
])->toJson(),
|
||||
|
@ -79,11 +79,13 @@
|
||||
@push('scripts')
|
||||
@if(Auth::check() && Auth::user()->group)
|
||||
<script>
|
||||
let maxSize = {{ Auth::user()->group->configs->get(\App\Enums\GroupConfigKey::MaximumFileSize) * 1024 }}
|
||||
let allowSuffixes = @json(Auth::user()->group->configs->get(\App\Enums\GroupConfigKey::AcceptedFileSuffixes));
|
||||
let maxSize = {{ Auth::user()->group->configs->get(\App\Enums\GroupConfigKey::MaximumFileSize) * 1024 }};
|
||||
</script>
|
||||
@else
|
||||
<script>
|
||||
let maxSize = {{ \App\Models\Group::getDefaultConfigs()->get(\App\Enums\GroupConfigKey::MaximumFileSize) * 1024 }}
|
||||
let allowSuffixes = @json(\App\Models\Group::getDefaultConfigs()->get(\App\Enums\GroupConfigKey::AcceptedFileSuffixes));
|
||||
let maxSize = {{ \App\Models\Group::getDefaultConfigs()->get(\App\Enums\GroupConfigKey::MaximumFileSize) * 1024 }};
|
||||
</script>
|
||||
@endif
|
||||
<script>
|
||||
@ -161,7 +163,6 @@
|
||||
add: (e, data) => {
|
||||
let file = data.files[0];
|
||||
let ext = file.name.substr(file.name.lastIndexOf('.') + 1);
|
||||
let allowSuffixes = ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'psd', 'svg', 'tiff', 'ico'];
|
||||
if (allowSuffixes.indexOf(ext.toLowerCase()) === -1) {
|
||||
toastr.warning(`不支持的文件格式 ${file.name}`);
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user