权限增加level

This commit is contained in:
zhl 2021-05-08 12:32:24 +08:00
parent 9a7fe7c73e
commit 3a24f7e48c
2 changed files with 10 additions and 1 deletions

View File

@ -14,6 +14,7 @@ class PermissionController extends BaseController {
record.name = data.name
record.actions = data.actions
record.sort = i
record.level = data.level
await record.save()
}
let ids = datas.map(o => o._id)

View File

@ -34,6 +34,13 @@ export class AdminPermissionClass extends BaseModule {
@prop({ default: true })
public show: boolean
/**
* ,
*
* @type {number}
*/
@prop()
public level: number
public toJson() {
return {
@ -42,7 +49,8 @@ export class AdminPermissionClass extends BaseModule {
children: this.actions.map(o => {
return { id: `${ this._id }:${ o }`, label: o }
}),
comment: this.comment
comment: this.comment,
level: this.level
}
}