角色API
1、添加角色
路径
URL: | {base-domain}/roles/ |
---|---|
METHOD | POST |
参数
{
"role_name":"财务",
"menus":[
{
"title":"订单",
"identifier":"order",
"children":[...],
"checked":true
}
]
}
返回值
同入参,多了一个role_id
2、修改角色
路径
URL: | {base-domain}/roles/{role_id} |
---|---|
METHOD | POST |
参数
{
"role_id":1
"role_name":"财务",
"menus":[
{
"title":"订单",
"identifier":"order",
"children":[...],
"checked":true
}
]
}
返回值
同入参
3、删除角色
路径
URL: | {base-domain}/roles/{role_id} |
---|---|
METHOD | DELETE |
注意:当角色下有管理员时,不能被删除
4、读取所有角色
路径
URL: | {base-domain}/roles |
---|---|
METHOD | GET |
返回值
[
{
role,role
}
]