From 96aef3ce94291f4833f57af6a07584ce1c9c3f59 Mon Sep 17 00:00:00 2001 From: JaguarJack <82664165@qq.com> Date: Tue, 21 Nov 2023 17:35:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=8F=9C=E5=8D=95=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/Permissions/Models/Permissions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/Permissions/Models/Permissions.php b/modules/Permissions/Models/Permissions.php index 99761db..473fffb 100644 --- a/modules/Permissions/Models/Permissions.php +++ b/modules/Permissions/Models/Permissions.php @@ -200,7 +200,9 @@ class Permissions extends Model $data['route'] = '/'.trim($data['route'], '/'); } - $data['component'] = Str::of($data['component'])->replace('\\', '/')->toString(); + if (isset($data['component'])) { + $data['component'] = Str::of($data['component'])->replace('\\', '/')->toString(); + } return parent::storeBy($data); }); } @@ -246,7 +248,9 @@ class Permissions extends Model $data['permission_mark'] = $parentMenu->permission_mark.'@'.$data['permission_mark']; } - $data['component'] = Str::of($data['component'])->replace('\\', '/')->toString(); + if (isset($data['component'])) { + $data['component'] = Str::of($data['component'])->replace('\\', '/')->toString(); + } return parent::updateBy($id, $data); } }