fix: 修复 actions 生成
This commit is contained in:
parent
3ac356a83f
commit
f354da3878
@ -164,10 +164,6 @@ class Permissions extends Model
|
||||
public function storeBy(array $data): mixed
|
||||
{
|
||||
return DB::transaction(function () use ($data){
|
||||
if ($data['type'] != MenuType::Top->value() && ! $data['parent_id']) {
|
||||
throw new FailedException('请选择父级菜单');
|
||||
}
|
||||
|
||||
if ($data['actions'] ?? false) {
|
||||
/* @var static $parentMenu */
|
||||
$parentMenu = $this->firstBy(value: $data['parent_id'], field: 'id');
|
||||
@ -194,6 +190,10 @@ class Permissions extends Model
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($data['type'] != MenuType::Top->value() && ! $data['parent_id']) {
|
||||
throw new FailedException('请选择父级菜单');
|
||||
}
|
||||
|
||||
$model = $this->fill($data);
|
||||
|
||||
if ($model->isAction()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user