Browse Source

修改安装时的菜单添加

wangeditor
chenlong 1 year ago
parent
commit
f0f433f621
  1. 6
      Install.php
  2. 14
      Uninstall.php

6
Install.php

@ -3,6 +3,8 @@
namespace Plugins\Notebook;
use App\Interfaces\PluginsInstallInterface;
use App\Model\Base\Route;
use App\Util\Hy;
use Hyperf\DbConnection\Db;
class Install implements PluginsInstallInterface
@ -10,7 +12,9 @@ class Install implements PluginsInstallInterface
public static function run(): void
{
$table = Route::getPrefix() . Route::table();
// 添加菜单
Db::insert("INSERT INTO `sd_module`.`sc_route` (`pid`, `type`, `title`, `icon`, `route`, `power_route`, `weigh`, `create_time`, `update_time`, `delete_time`) VALUES (0, 1, '笔记本', 'Document', '/admin/plugins/notebook/lists', NULL, 1, '2023-09-24 12:36:45', '2023-09-24 12:36:45', NULL);");
Db::insert("INSERT INTO `$table` (`pid`, `type`, `title`, `icon`, `route`, `power_route`, `weigh`, `create_time`, `update_time`, `delete_time`) VALUES (0, 1, '笔记本', 'Document', '/admin/plugins/notebook/lists', NULL, 1, '2023-09-24 12:36:45', '2023-09-24 12:36:45', NULL);");
}
}

14
Uninstall.php

@ -0,0 +1,14 @@
<?php
namespace Plugins\Notebook;
use App\Interfaces\PluginsInstallInterface;
class Uninstall implements PluginsInstallInterface
{
public static function run(): void
{
echo "笔记本卸载完成,请手动删除对应菜单\n";
}
}
Loading…
Cancel
Save