- 必须先读
- Ajax编程_V7.6大纲配套
- 数据可视化
- Vue基础
- Vue_大事件
- 黑马头条号
- 极客园_PC
- 极客园(黑马头条)_移动端
- 人资项目
- 小兔鲜电商
- 小程序基础
- 小程序项目
- layui_大事件
- 品优购电商后台
- 其他可用接口
新增-权限点
POST
/sys/permission
注意2: 新增时, 权限标识不能和所有人重复, 应该是唯一的标识
请求参数
Header 参数
Authorization
string
必需
示例值:
{{Vue2_HR_ACCESS_TOKEN}}
Body 参数application/json
name
string
权限点名字
code
string
权限点标识
重要, 后续前端需要用此值做判断
description
string
权限点描述
type
integer
权限点类型
pid
string
权限点父级id
enVisible
string
权限点开启状态
示例
{
"name": "审批页面",
"code": "approval",
"description": "是否可以进入审批页面",
"type": 1,
"pid": "0",
"enVisible": "0"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://ihrm.itheima.net/prod-api/sys/permission' \
--header 'Authorization: {{Vue2_HR_ACCESS_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "审批页面",
"code": "approval",
"description": "是否可以进入审批页面",
"type": 1,
"pid": "0",
"enVisible": "0"
}'
返回响应
🟢200成功
application/json
Body
success
boolean
响应状态
code
integer
业务状态码
data
object
响应数据
_id
string
数据id
name
string
权限点名字
code
string
权限点标识
description
string
权限点描述
type
integer
权限点类型
pid
string
权限点父级id
enVisible
string
权限点开启状态
__v
integer
必需
message
string
响应消息
示例
{
"success": true,
"code": 10000,
"data": {
"_id": "62a9a303b7aa47052429827d",
"name": "审批页面",
"code": "approval",
"description": "是否可以进入审批页面",
"type": 1,
"pid": "0",
"enVisible": "0",
"__v": 0
},
"message": "添加权限点成功"
}
修改于 2022-07-10 03:09:39