初始字段

$fields = [
    'op_name'      => 'subscriber',//角色名
    'op_valte'     => 'api/token/refresh',//权限节点
    'op_module'    => 'demo',//应用名
    'op_controll'  => 'auth',//固定值
    'op_action'    => 'back',//后台(back)|前台(front)
    'op_order'     => 0,
    'op_status'    => 'normal',
    'op_autoload'  => 'no',
];

卸载插件时按应用名批量删除权限

model('common/Auth','loglic')->uninstall('demo');

安装插件时批量添加权限

model('common/Auth','loglic')->install([
    [
        'op_name'     => 'subscriber',//角色名
        'op_value'    => 'api/token/refresh',//权限节点
        'op_module'   => 'demo',
        'op_action'   => 'back',
    ],
    [
        'op_name'     => 'subscriber',
        'op_value'    => 'api/upload/save',
        'op_module'   => 'demo',
        'op_action'   => 'front',
    ]
]);