权限增加level
This commit is contained in:
parent
9a7fe7c73e
commit
3a24f7e48c
@ -14,6 +14,7 @@ class PermissionController extends BaseController {
|
|||||||
record.name = data.name
|
record.name = data.name
|
||||||
record.actions = data.actions
|
record.actions = data.actions
|
||||||
record.sort = i
|
record.sort = i
|
||||||
|
record.level = data.level
|
||||||
await record.save()
|
await record.save()
|
||||||
}
|
}
|
||||||
let ids = datas.map(o => o._id)
|
let ids = datas.map(o => o._id)
|
||||||
|
@ -34,6 +34,13 @@ export class AdminPermissionClass extends BaseModule {
|
|||||||
|
|
||||||
@prop({ default: true })
|
@prop({ default: true })
|
||||||
public show: boolean
|
public show: boolean
|
||||||
|
/**
|
||||||
|
* 权限选择时, 需要的用户等级
|
||||||
|
* 用户等级需要小于或等于该值才可显示
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
@prop()
|
||||||
|
public level: number
|
||||||
|
|
||||||
public toJson() {
|
public toJson() {
|
||||||
return {
|
return {
|
||||||
@ -42,7 +49,8 @@ export class AdminPermissionClass extends BaseModule {
|
|||||||
children: this.actions.map(o => {
|
children: this.actions.map(o => {
|
||||||
return { id: `${ this._id }:${ o }`, label: o }
|
return { id: `${ this._id }:${ o }`, label: o }
|
||||||
}),
|
}),
|
||||||
comment: this.comment
|
comment: this.comment,
|
||||||
|
level: this.level
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user