菜单

菜单列表

接口描述 : 菜单列表

请求路径 : /v1/menus

请求方法 : GET

请求头:

  1. Content-Type: application/json
  2. Authorization: Bearer + token

请求参数 : 参数类型 params | 参数 | 值 | 类型 | 说明 | 必须 | |:—————:|:————-:|:——-:| :————-:|:——: | | page | 1 | String | 指定第几页 | true | | per_page | 30 | String | 每页的记录数 | true |

示例:

  1. /menus?page=2&per_page=30

响应数据 :

  1. {
  2. "code": 0,
  3. "data": {
  4. "result": [
  5. {
  6. "icon": "peoples",
  7. "id": "1",
  8. "menu_type": "1",
  9. "name": "权限管理",
  10. "order_num": "1",
  11. "parent_id": "0",
  12. "perms": "",
  13. "url": "/permission"
  14. },
  15. {
  16. "icon": "peoples",
  17. "id": "2",
  18. "menu_type": "1",
  19. "name": "用户管理",
  20. "order_num": "1",
  21. "parent_id": "1",
  22. "perms": "",
  23. "url": "/permission/user"
  24. }
  25. ]
  26. },
  27. "msg": "success"
  28. }

添加菜单

接口描述 : 添加菜单

请求路径 : /v1/menus

请求方法 : POST

请求头:

  1. Content-Type: application/json
  2. Authorization: Bearer + token

请求参数 : 参数类型 params | 参数 | 值 | 类型 | 说明 | 必须 | |:—————:|:————-:|:——-:| :————-:|:——: | |parent_id | 1 | String | 父节点id | true| |domain_id | 1 | String | 域名id | true| |name | 角色管理 | String | 备注 | true| |url | http://www.xxx.com | String | URL | true| |perms | 1,2,4 | string | 角色 | true| |menu_type | 1,2,4 | String | 菜单类型 | true| |icon | sexxs | String | 数据权限ID | false| |order_num | 1 | int | 排序 | false|

示例:

  1. parent_id:2
  2. domain_id:1
  3. name:查看
  4. url:
  5. perms:
  6. menu_type:1
  7. icon:sexxs
  8. order_num:0

响应数据 :

  1. {
  2. "code": 200,
  3. "msg": "success",
  4. "data": {
  5. }
  6. }

编辑菜单

接口描述 : 编辑菜单

请求路径 : /v1/menus/<ID>

请求方法 : PUT

请求头:

  1. Content-Type: application/json
  2. Authorization: Bearer + token

请求参数 : 参数类型 params | 参数 | 值 | 类型 | 说明 | 必须 | |:—————:|:————-:|:——-:| :————-:|:——: | |parent_id | 1 | String | 父节点id | true| |domain_id | 1 | String | 域名id | true| |name | 角色管理 | String | 备注 | true| |url | http://www.xxx.com | String | URL | true| |perms | 1,2,4 | string | 角色 | true| |menu_type | 1,2,4 | String | 菜单类型 | true| |icon | sexxs | String | 数据权限ID | false| |order_num | 1 | int | 排序 | false|

响应数据 :

  1. {
  2. "code": 200,
  3. "msg": "success",
  4. "data": {
  5. }
  6. }

删除菜单

接口描述 : 删除菜单

请求路径 : /v1/menus/<ID>

请求方法 : DELETE

请求头:

  1. Content-Type: application/json
  2. Authorization: Bearer + token

响应数据 :

  1. {
  2. "code": 200,
  3. "msg": "success",
  4. "data": {
  5. }
  6. }