完善角色组编辑页面

This commit is contained in:
Wisp X 2022-01-22 14:19:12 +08:00
parent 5662f86aae
commit 4975f3e1c1
7 changed files with 23 additions and 13 deletions

View File

@ -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

View File

@ -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;

View File

@ -0,0 +1,10 @@
<?php
namespace App\Mappers;
use JsonMapper\Middleware\Attributes\MapFrom;
class GroupConfig
{
public int $maximumFileSize = 5120;
}

View File

@ -5,7 +5,7 @@ namespace App\Models;
use App\Enums\GroupConfigKey;
use App\Enums\Strategy\LocalOption;
use App\Enums\StrategyKey;
use App\Service\ImageService;
use App\Services\ImageService;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Service;
namespace App\Services;
use App\Enums\ConfigKey;
use App\Enums\GroupConfigKey;

View File

@ -15,11 +15,11 @@ return [
ConfigKey::SiteKeywords => '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',

View File

@ -25,6 +25,7 @@
<label for="name" class="block text-sm font-medium text-gray-700"><span class="text-red-600">*</span>组名称</label>
@if($group->id == 0)
<input type="text" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md bg-gray-100" value="{{ $group->name }}" disabled readonly>
<input type="hidden" name="name" id="name" value="{{ $group->name }}">
@else
<input type="text" name="name" id="name" autocomplete="name" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" placeholder="请输入组名称" value="{{ $group->name }}">
@endif