npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rbac-sequelize-mysql

v1.0.2

Published

test

Readme

开发中,暂无法使用

alt 属性文本

install

npm install --save rbac-sequelize-mysql

use

const express = require("express");
const option={}
const { rbacSequelizeMysql, config } = require('rbac-sequelize-mysql').init(option)
const app = express()
app.use(rbacSequelizeMysql)

注:rbacSequelizeMysql 为中间件实例,config 为经过中间件处理过后的标准 option 信息

option

| 参数 | 类型 | 是否必填 | 意义 | | :------: | :----: | :------: | :------------------------- | | host | IP | 是 | 数据库 IP | | database | 字符串 | 是 | 数据库名称 | | user | 字符串 | 是 | 数据库用户名 | | password | 字符串 | 是 | 数据库访问密码 | | saas | 布尔 | 否 | 是否开启 saas 模式,默认否 | | dept | 布尔 | 否 | 是否开启部门功能,默认否 | | paranoid | 布尔 | 否 | 是否开启软删除模式,默认否 | | api | 对象 | 否 | 接口地址 | | table | 对象 | 否 | 表名 |

api

| 参数 | 类型 | 默认 | 意义 | 可选值 | | :----: | :--: | :---: | :----------------- | :---------------------------------- | | method | 枚举 | false | 所有接口的提交类型 | [false,'post','get','put','delete'] |

table

| 参数 | 类型 | 默认 | 意义 | | :-------------: | :----: | :-----------------: | :--------------------------------------- | | api | 字符串 | sys_api | 所有接口列表 | | authority | 字符串 | sys_authority | 权限码表 | | permission | 字符串 | sys_permission | 授权表,用于用户表绑定 | | role | 字符串 | sys_role | 角色表, | | permission_role | 字符串 | sys_permission_role | 角色授权中间表 | | dept | 字符串 | sys_dept | 部门表(仅在开启部门功能后生效) | | dept_role | 字符串 | sys_dept_role | 部门授权中间表(仅在开启部门功能后生效) |

option 完整参数

{
  host: '',
  database: '',
  user: '',
  password: '',
  saas:false,
  dept:false,
  paranoid:false,
  api: {
    method:false,
    api: {
      init: { url: '/api/init', method: 'post' },
      sync: { url: '/api/sync', method: 'post' },
      list: { url: '/api/list', method: 'get' },
      save: { url: '/api/save', method: 'post' },
      del: { url: '/api/del', method: 'post' },
    },
    authority: {
      init: { url: '/authority/init', method: 'post' },
      sync: { url: '/authority/sync', method: 'post' },
      list: { url: '/authority/list', method: 'get' },
      save: { url: '/authority/save', method: 'post' },
      del: { url: '/authority/del', method: 'post' },
    },
    permission: {
      init: { url: '/permission/init', method: 'post' },
      sync: { url: '/permission/sync', method: 'post' },
      list: { url: '/permission/list', method: 'get' },
      save: { url: '/permission/save', method: 'post' },
      del: { url: '/permission/del', method: 'post' },
    },
    role: {
      init: { url: '/role/init', method: 'post' },
      sync: { url: '/role/sync', method: 'post' },
      list: { url: '/role/list', method: 'get' },
      save: { url: '/role/save', method: 'post' },
      del: { url: '/role/del', method: 'post' },
    },
    dept: {
      init: { url: '/dept/init', method: 'post' },
      sync: { url: '/dept/sync', method: 'post' },
      list: { url: '/dept/list', method: 'get' },
      save: { url: '/dept/save', method: 'post' },
      del: { url: '/dept/del', method: 'post' },
    },
  },
  table: {
    api: 'sys_api',
    authority: 'sys_authority',
    permission: 'sys_permission',
    role: 'sys_role',
    permission_role: 'sys_permission_role',
    dept: 'sys_dept',
    dept_role: 'sys_dept_role',
  },
}