获取左侧菜单

简要描述

前端项目在用户登录成功之后会获取用户的菜单树

请求 URL

请求方式

  • GET

请求示例

请求参数

返回示例

{
  "code": 200,
  "msg": "成功",
  "data": [
    {
      "id": "1",
      "pid": "0",
      "sort": 0,
      "skip": true,
      "name": "主页",
      "icon": "home",
      "path": "/space/home",
      "level": 1,
      "type": 1,
      "options": 1,
      "description": null,
      "createUser": "1",
      "updateTime": "2023-10-15 15:13:34"
    },
    {
      "id": "2",
      "pid": "0",
      "sort": 1,
      "skip": false,
      "children": [
        {
          "id": "192",
          "pid": "2",
          "sort": null,
          "skip": false,
          "name": null,
          "icon": null,
          "path": "/idea/192",
          "level": 2,
          "type": 0,
          "options": 0,
          "description": null,
          "createUser": "2",
          "updateTime": "2024-04-16 20:38:00"
        }
      ],
      "name": "我的空间",
      "icon": "personal",
      "path": "/space/personal",
      "level": 1,
      "type": 1,
      "options": 0,
      "description": null,
      "createUser": "1",
      "updateTime": "2023-10-15 15:13:34"
    },
    {
      "id": "3",
      "pid": "0",
      "sort": 2,
      "skip": false,
      "name": "团队空间",
      "icon": "team",
      "path": "/space/team",
      "level": 1,
      "type": 1,
      "options": 0,
      "description": null,
      "createUser": "1",
      "updateTime": "2023-10-15 15:13:34"
    }
  ],
  "success": true
}

返回参数

参数名类型说明
codeint200成功,非200失败
msgstring错误信息
idstring唯一标识
pidstring父 id,唯一标识
sortstring排序
skipstring内部字段
namestring菜单名称
iconstring菜单 icon
pathstring菜单路径
levelstring菜单层级
typestring菜单类型
optionsstring菜单是否可操作
descriptionstring菜单描述
createUserstring创建人
updateTimestring更新时间
successboolean是否成功

分页获取菜单列表

简要描述

分页获取菜单列表

请求 URL

请求方式

  • GET

请求示例

{
  "current": 1,
  "pageSize": 10,
  "menuId": 2
}

请求参数

参数名类型必选说明
currentnumber当前页
pageSizenumber每页条数
menuIdnumber菜单 id

返回示例

{
  "code": 200,
  "msg": "成功",
  "data": {
    "records": [
      {
        "id": "192",
        "pid": "2",
        "name": null,
        "icon": null,
        "path": "/idea/192",
        "level": 2,
        "sort": null,
        "type": 0,
        "options": 0,
        "description": null,
        "createUser": "2",
        "updateTime": "2024-04-16 20:38:00",
        "deleted": 0
      },
      {
        "id": "191",
        "pid": "2",
        "name": null,
        "icon": null,
        "path": "/idea/191",
        "level": 2,
        "sort": null,
        "type": 0,
        "options": 0,
        "description": null,
        "createUser": "2",
        "updateTime": "2024-04-16 20:37:33",
        "deleted": 0
      },
      {
        "id": "189",
        "pid": "2",
        "name": null,
        "icon": null,
        "path": "/idea/189",
        "level": 2,
        "sort": null,
        "type": 0,
        "options": 0,
        "description": null,
        "createUser": "2",
        "updateTime": "2024-04-16 20:36:29",
        "deleted": 0
      }
    ],
    "total": "3",
    "current": "1",
    "pages": "1",
    "hasPrevious": false,
    "hasNext": false
  },
  "success": true
}

返回参数

参数名类型说明
codeint200成功,非200失败
msgstring错误信息
totalnumber总条数
currentnumber当前页
pagesnumber总页数
hasPreviousboolean是否有上一页
hasNextboolean是否有下一页
idstring唯一标识
pidstring父 id,唯一标识
sortstring排序
skipstring内部字段
namestring菜单名称
iconstring菜单 icon
pathstring菜单路径
levelstring菜单层级
typestring菜单类型
optionsstring菜单是否可操作
descriptionstring菜单描述
createUserstring创建人
updateTimestring更新时间
successboolean是否成功

创建文件夹

简要描述

创建文件夹

请求 URL

请求方式

  • POST

请求示例

{
  "pid": 1,
  "name": "Open-Idea",
  "type": 1,
  "description": "随时随地记录想法"
}

请求参数

参数名类型必选说明
pidnumber父级id
namestring文件夹/文件名称
typenumber文件夹
descriptionnumber描述

返回示例

{
  "code": 200,
  "msg": "成功",
  "data": null,
  "success": true
}

返回参数

参数名类型说明
codeint200成功,非200失败
msgstring错误信息
successboolean是否成功

修改菜单名称

简要描述

修改菜单名称

请求 URL

请求方式

  • PUT

请求示例

{
  "id": 1,
  "name": "Open-Idea",
  "description": "随时随地记录想法"
}

请求参数

参数名类型必选说明
idnumber父级id
namestring文件夹/文件名称
descriptionnumber描述

返回示例

{
  "code": 200,
  "msg": "成功",
  "data": null,
  "success": true
}

返回参数

参数名类型说明
codeint200成功,非200失败
msgstring错误信息
successboolean是否成功