sp-auth 权限管理
是基于super-project的权限配置和访问控制模块,主要包含了:
user_access_token
创建和查找ACL
判断逻辑
挂载middleware
const acl = const config = app
使用service
// file: User.js
// file: instance.js const config = const mysql = configmysql const userModel = mysqlconst userAccessTokenModel = mysql const authService = authService
register({ status, role })
login(userId)
ACL Example
// acl 配置样例// 黑名单和白名单结构一样 moduleexports = ANYONE: '/login|*' '/register|get' '/register|post' '/forget|get' ADMIN: '/dashboard|*' '/report|*' '/account/*|get'