优化架构,新增路由
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
* 账号密码注册
|
||||
* @param {string} data.account 账号.
|
||||
* @param {string} data.password 密码.
|
||||
* @param {string} data.oid 机构id
|
||||
* @return {boolean} 注册 是否 成功.
|
||||
*/
|
||||
module.exports = async (data) => {
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
module.exports = {
|
||||
doc: "分组表",
|
||||
api: true,//是否需要生成api接口
|
||||
model: {
|
||||
gid: {type: "STRING", comment: '分组id'},
|
||||
name: {type: "STRING", comment: '分组名称'},
|
||||
to_gid: {type: "STRING", comment: '上级分组id'},
|
||||
to_oid: {type: "STRING", comment: '所属组织id'},
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ module.exports = {
|
||||
api: true,//是否需要生成api接口
|
||||
model: {
|
||||
pid: {type: "STRING", comment: '权限id'},
|
||||
to_pccode: {type: "STRING", comment: '所属权限分类码'},
|
||||
name: {type: "STRING", comment: '权限名称'},
|
||||
type: {type: "STRING", comment: '权限类型:接口/字段/表格/按钮:jk/zd/bg/an'},
|
||||
code: {type: "STRING", comment: '权限识别码'},
|
||||
value: {type: "STRING", comment: '权限值'},
|
||||
},
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
module.exports = {
|
||||
doc: "权限分类表",
|
||||
api: true,//是否需要生成api接口
|
||||
model: {
|
||||
name: {type: "STRING", comment: '权限分类名称'},
|
||||
pccode: {type: "STRING", comment: '权限分类识别码'},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,7 @@ module.exports = {
|
||||
model: {
|
||||
rid: {type: "STRING", comment: '角色id'},
|
||||
name: {type: "STRING", comment: '角色名称'},
|
||||
to_rid: {type: "STRING", comment: '上级角色id'},
|
||||
to_oid: {type: "STRING", comment: '所属组织id'},
|
||||
to_gid: {type: "STRING", comment: '所属分组id'},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ module.exports = {
|
||||
doc: "角色拥有的权限",
|
||||
api: true,//是否需要生成api接口
|
||||
model: {
|
||||
rpid: {type: "STRING", comment: '角色权限id'},
|
||||
to_rid: {type: "STRING", comment: '角色id'},
|
||||
to_pid: {type: "STRING", comment: '权限id'},
|
||||
},
|
||||
|
||||
@@ -7,9 +7,7 @@ module.exports = {
|
||||
password: {type: "STRING", comment: '用户加密密码'},
|
||||
salt: {type: "STRING", comment: '用户加密随机数'},
|
||||
to_oid: {type: "STRING", comment: '所属组织id'},
|
||||
to_gid: {type: "STRING", comment: '所属分组id'},
|
||||
to_rid: {type: "STRING", comment: '所属角色id'},
|
||||
to_uid: {type: "STRING", comment: '上级用户id'},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ module.exports = {
|
||||
app.use(router.routes()).use(router.allowedMethods())
|
||||
},
|
||||
fun : async (app) => {
|
||||
const parameter = app.parameter
|
||||
const router = new Router({ //设置前缀
|
||||
prefix: config.prefix
|
||||
});
|
||||
@@ -25,6 +24,7 @@ module.exports = {
|
||||
console.log(url);
|
||||
router.all(url, async (ctx, next) => {
|
||||
await next();
|
||||
const parameter = app.parameter
|
||||
const validate = parameter.validate(item.res.params, ctx.params);
|
||||
let res = null
|
||||
if (validate) {
|
||||
|
||||
Reference in New Issue
Block a user