diff --git a/app/Http/Controllers/Admin/GroupController.php b/app/Http/Controllers/Admin/GroupController.php index d0bb238a..83a186b8 100644 --- a/app/Http/Controllers/Admin/GroupController.php +++ b/app/Http/Controllers/Admin/GroupController.php @@ -3,7 +3,6 @@ namespace App\Http\Controllers\Admin; use App\Enums\ConfigKey; -use App\Enums\GroupConfigKey; use App\Http\Controllers\Controller; use App\Http\Requests\Admin\GroupRequest; use App\Models\Group; @@ -74,9 +73,9 @@ class GroupController extends Controller return $this->success('success', $request->validated()); } - public function update(Request $request): Response + public function update(GroupRequest $request): Response { - return $this->success('success', $request->all()); + return $this->success('success', $request->validated()); } public function delete(Request $request): Response diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 1a0b0b01..b96fd9e9 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -7,7 +7,7 @@ use App\Exceptions\UploadException; use App\Http\Api; use App\Models\Image; use App\Models\User; -use App\Service\ImageService; +use App\Services\ImageService; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Validation\ValidatesRequests; diff --git a/app/Mappers/GroupConfig.php b/app/Mappers/GroupConfig.php new file mode 100644 index 00000000..78026ade --- /dev/null +++ b/app/Mappers/GroupConfig.php @@ -0,0 +1,10 @@ + 'Lsky Pro,lsky,兰空图床', ConfigKey::SiteDescription => 'Lsky Pro, Your photo album on the cloud.', ConfigKey::IcpNo => '', - ConfigKey::IsEnableRegistration => 1, - ConfigKey::IsEnableGallery => 1, - ConfigKey::IsAllowGuestUpload => 1, + ConfigKey::IsEnableRegistration => true, + ConfigKey::IsEnableGallery => true, + ConfigKey::IsAllowGuestUpload => true, ConfigKey::UserInitialCapacity => 512000, - ConfigKey::IsUserNeedVerify => 1, + ConfigKey::IsUserNeedVerify => true, ConfigKey::MailConfigs => [ 'default' => 'smtp', 'mailers' => [ @@ -35,9 +35,9 @@ return [ ConfigKey::GroupConfigs => [ GroupConfigKey::MaximumFileSize => 5120, GroupConfigKey::ConcurrentUploadNum => 3, - GroupConfigKey::IsEnableScan => 0, - GroupConfigKey::IsEnableWatermark => 0, - GroupConfigKey::IsEnableOriginalProtection => 0, + GroupConfigKey::IsEnableScan => false, + GroupConfigKey::IsEnableWatermark => false, + GroupConfigKey::IsEnableOriginalProtection => false, GroupConfigKey::ScannedAction => 'mark', // in mark or delete GroupConfigKey::ScanConfigs => [ 'driver' => 'aliyun', diff --git a/resources/views/admin/group/edit.blade.php b/resources/views/admin/group/edit.blade.php index a429eb6e..602590e3 100644 --- a/resources/views/admin/group/edit.blade.php +++ b/resources/views/admin/group/edit.blade.php @@ -25,6 +25,7 @@ @if($group->id == 0) + @else @endif