获取菜单
<p><strong>简要描述:</strong> </p>
<ul>
<li>获取菜单及按钮权限列表</li>
</ul>
<p><strong>请求URL:</strong> </p>
<ul>
<li><code>http://xx.com/admin/menu/list</code></li>
</ul>
<p><strong>请求方式:</strong></p>
<ul>
<li>POST </li>
</ul>
<p><strong>参数:</strong>
无</p>
<p><strong>返回示例</strong></p>
<pre><code> {
"code": 0,
"msg": "success",
"data": [
{
"id": 1000,
"parentId": -1,
"children": [
{
"id": 1100,
"parentId": 1000,
"children": [
{
"id": 1101,
"parentId": 1100,
"children": [],
"icon": null,
"name": "用户新增",
"permission": "sys_user_add",
"path": null,
"component": null,
"keepAlive": "0",
"type": "1",
"label": "用户新增",
"sort": null
},
{
"id": 1102,
"parentId": 1100,
"children": [],
"icon": null,
"name": "用户修改",
"permission": "sys_user_edit",
"path": null,
"component": null,
"keepAlive": "0",
"type": "1",
"label": "用户修改",
"sort": null
},
{
"id": 1103,
"parentId": 1100,
"children": [],
"icon": null,
"name": "用户删除",
"permission": "sys_user_del",
"path": null,
"component": null,
"keepAlive": "0",
"type": "1",
"label": "用户删除",
"sort": null
}
],
"icon": "icon-yonghuguanli",
"name": "用户管理",
"permission": null,
"path": "user",
"component": "views/admin/user/index",
"keepAlive": "0",
"type": "0",
"label": "用户管理",
"sort": 1
},
{
"id": 1300,
"parentId": 1000,
"children": [
{
"id": 1301,
"parentId": 1300,
"children": [],
"icon": null,
"name": "角色新增",
"permission": "sys_role_add",
"path": null,
"component": null,
"keepAlive": "0",
"type": "1",
"label": "角色新增",
"sort": null
},
{
"id": 1302,
"parentId": 1300,
"children": [],
"icon": null,
"name": "角色修改",
"permission": "sys_role_edit",
"path": null,
"component": null,
"keepAlive": "0",
"type": "1",
"label": "角色修改",
"sort": null
},
{
"id": 1303,
"parentId": 1300,
"children": [],
"icon": null,
"name": "角色删除",
"permission": "sys_role_del",
"path": null,
"component": null,
"keepAlive": "0",
"type": "1",
"label": "角色删除",
"sort": null
},
{
"id": 1304,
"parentId": 1300,
"children": [],
"icon": null,
"name": "分配权限",
"permission": "sys_role_perm",
"path": null,
"component": null,
"keepAlive": "0",
"type": "1",
"label": "分配权限",
"sort": null
}
],
"icon": "icon-jiaoseguanli",
"name": "角色管理",
"permission": null,
"path": "role",
"component": "views/admin/role/index",
"keepAlive": "0",
"type": "0",
"label": "角色管理",
"sort": 3
},
{
"id": 1200,
"parentId": 1000,
"children": [
{
"id": 1201,
"parentId": 1200,
"children": [],
"icon": null,
"name": "菜单新增",
"permission": "sys_menu_add",
"path": null,
"component": null,
"keepAlive": "0",
"type": "1",
"label": "菜单新增",
"sort": null
},
{
"id": 1202,
"parentId": 1200,
"children": [],
"icon": null,
"name": "菜单修改",
"permission": "sys_menu_edit",
"path": null,
"component": null,
"keepAlive": "0",
"type": "1",
"label": "菜单修改",
"sort": null
},
{
"id": 1203,
"parentId": 1200,
"children": [],
"icon": null,
"name": "菜单删除",
"permission": "sys_menu_del",
"path": null,
"component": null,
"keepAlive": "0",
"type": "1",
"label": "菜单删除",
"sort": null
}
],
"icon": "icon-caidanguanli",
"name": "菜单管理",
"permission": null,
"path": "menu",
"component": "views/admin/menu/index",
"keepAlive": "0",
"type": "0",
"label": "菜单管理",
"sort": 2
},
{
"id": 1400,
"parentId": 1000,
"children": [
{
"id": 1401,
"parentId": 1400,
"children": [],
"icon": null,
"name": "部门新增",
"permission": "sys_dept_add",
"path": null,
"component": null,
"keepAlive": "0",
"type": "1",
"label": "部门新增",
"sort": null
},
{
"id": 1402,
"parentId": 1400,
"children": [],
"icon": null,
"name": "部门修改",
"permission": "sys_dept_edit",
"path": null,
"component": null,
"keepAlive": "0",
"type": "1",
"label": "部门修改",
"sort": null
},
{
"id": 1403,
"parentId": 1400,
"children": [],
"icon": null,
"name": "部门删除",
"permission": "sys_dept_del",
"path": null,
"component": null,
"keepAlive": "0",
"type": "1",
"label": "部门删除",
"sort": null
}
],
"icon": "icon-web-icon-",
"name": "部门管理",
"permission": null,
"path": "dept",
"component": "views/admin/dept/index",
"keepAlive": "0",
"type": "0",
"label": "部门管理",
"sort": 4
}
],
"icon": "icon-quanxianguanli",
"name": "权限管理",
"permission": null,
"path": "/upms",
"component": "Layout",
"keepAlive": "0",
"type": "0",
"label": "权限管理",
"sort": 0
}
]
}</code></pre>
<p><strong>返回参数说明</strong> </p>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">id</td>
<td style="text-align: left;">int</td>
<td>菜单ID</td>
</tr>
<tr>
<td style="text-align: left;">name</td>
<td style="text-align: left;">String</td>
<td>菜单名称</td>
</tr>
<tr>
<td style="text-align: left;">icon</td>
<td style="text-align: left;">String</td>
<td>图标</td>
</tr>
<tr>
<td style="text-align: left;">path</td>
<td style="text-align: left;">String</td>
<td>前端URL</td>
</tr>
<tr>
<td style="text-align: left;">component</td>
<td style="text-align: left;">String</td>
<td>VUE页面</td>
</tr>
<tr>
<td style="text-align: left;">parentId</td>
<td style="text-align: left;">int</td>
<td>父菜单ID</td>
</tr>
<tr>
<td style="text-align: left;">type</td>
<td style="text-align: left;">String</td>
<td>菜单类型 (0菜单 1按钮)</td>
</tr>
<tr>
<td style="text-align: left;">children</td>
<td style="text-align: left;">object</td>
<td>子菜单</td>
</tr>
<tr>
<td style="text-align: left;">sort</td>
<td style="text-align: left;">int</td>
<td>排序值</td>
</tr>
<tr>
<td style="text-align: left;">permission</td>
<td style="text-align: left;">String</td>
<td>权限代码</td>
</tr>
</tbody>
</table>
<p><strong>备注</strong> </p>
<ul>
<li>更多返回错误代码请看首页的错误代码描述</li>
</ul>
<p>欢迎使用ShowDoc!</p>