From ecac02aa7b5d20df311a0fa1587b586577b8db0f Mon Sep 17 00:00:00 2001 From: Slowlyo Date: Thu, 12 Oct 2023 23:15:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Console/Module/UpdateCommand.php | 1 + src/Controllers/AdminRoleController.php | 2 +- src/Support/Cores/JsonResponse.php | 5 ----- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Console/Module/UpdateCommand.php b/src/Console/Module/UpdateCommand.php index 9ae236c8..7c08f2af 100644 --- a/src/Console/Module/UpdateCommand.php +++ b/src/Console/Module/UpdateCommand.php @@ -30,6 +30,7 @@ protected function updateViews() $modules = config('admin.modules'); if (blank($modules)) { + $this->warn('No modules, please check config: [admin.modules]'); return; } diff --git a/src/Controllers/AdminRoleController.php b/src/Controllers/AdminRoleController.php index 3a18b17f..709c1214 100644 --- a/src/Controllers/AdminRoleController.php +++ b/src/Controllers/AdminRoleController.php @@ -71,7 +71,7 @@ protected function setPermission() ->multiple() ->options(AdminPermissionService::make()->getTree()) ->searchable() - ->onlyChildren() + ->cascade() ->joinValues(false) ->extractValue() ->size('full') diff --git a/src/Support/Cores/JsonResponse.php b/src/Support/Cores/JsonResponse.php index 90f8f57b..0fef4a9e 100644 --- a/src/Support/Cores/JsonResponse.php +++ b/src/Support/Cores/JsonResponse.php @@ -2,7 +2,6 @@ namespace Slowlyo\OwlAdmin\Support\Cores; -use Slowlyo\OwlAdmin\Renderers\BaseRenderer; use Illuminate\Http\Resources\Json\JsonResource; class JsonResponse @@ -45,10 +44,6 @@ public function success($data = null, string $message = ''): \Illuminate\Http\Js $data = (object)$data; } - if ($data instanceof BaseRenderer) { - $data = $data->toArray(); - } - return response()->json(array_merge($this->additionalData, ['data' => $data])); }