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

hpsfir-managebase

v0.2.1

Published

+ 打包后项目中引入,编译发布 + RBAC(Role-Based Access Control)即:基于角色的权限控制。通过角色关联用户,角色关联权限点的方式间接赋予用户系统权限 + 2、RBAC模型可以分为:RBAC0、RBAC1、RBAC2、RBAC3 四种。其中RBAC0是基础,也是最简单的,相当于底层逻辑,RBAC1、RBAC2、RBAC3都是以RBAC0为基础的升级。

Downloads

182

Readme

Hpsfir管理系统底座 - 编译型

  • 打包后项目中引入,编译发布
  • RBAC(Role-Based Access Control)即:基于角色的权限控制。通过角色关联用户,角色关联权限点的方式间接赋予用户系统权限
  • 2、RBAC模型可以分为:RBAC0、RBAC1、RBAC2、RBAC3 四种。其中RBAC0是基础,也是最简单的,相当于底层逻辑,RBAC1、RBAC2、RBAC3都是以RBAC0为基础的升级。

    2.1、RBAC0指通过用户、角色、权限点三者实现的权限控制模式,它可以基于用户与角色之间的关系,分为用户、角色多对一模式和多对多模式。

    2.2、RBAC1指在RBAC0模型,增加子角色,引入了继承概念,即子角色可以继承父角色的权限。

    2.3、RBAC2指RBAC0模型,增加了对角色的一些限制,例如:角色互斥、基数约束、先决条件角色等。

    2.4、RBAC3指统合模式,它包含了RBAC1和RBAC2,利用传递性,也把RBAC0包括在内,综合了RBAC0、RBAC1和RBAC2的所有特性。


使用注意

基础管理系统占用以下类名称:

// 所有以Base开头的
Base***
// 所哟以BASE_开头的
BASE_***

基础管理系统占用以下路由:

// 所以以 /__base 开头的路由
/__base/**

基础管理系统占用以下数据库表名称:

// 所有以base_开头的数据库
base_**

提供以下装饰器:

/**
 * 授权角色
 * @param roleKeys 可授权的角色列表
 * @returns
 */
export function AuthRole(roleKeys: string[]): Function;

基础登录拦截器

基础登录拦截器实现了对基础用户进行请求拦截,判断请求头中 Authorization 字段是否存在,该字段中存储了token信息。

可以通过在 .env.${evn} 配置文件中添加 AUTH_PREFIXS 字段,用于对指定的路由前缀进行登录拦截。

以下配置将admin和cunstomer前缀的路由进行登录拦截

AUTH_PREFIXS=admin,customer

全局基础配置

resource/config.json 中提供全局配置。基础管理系统提供了以下配置项:

// 是否开启密码hash
"disableEncodePw": true,
// 如果开启密码hash,加盐值
"salt": "hpsfirmanage"

所有全局配置信息可通过注入 BaseConfigService 服务来读取。

雪花算法服务

基础管理系统已实现雪花算法,可以通过注入 BaseSnowflakeService 服务来实现

定时任务服务

基础管理系统已实现定时任务功能,可以通过注入 BaseScheduleService 服务来实现

todo

  • 树形表搜索问题
  • 树形表权限问题(父级权限子权限)