---
title: "增加menu和角色关联关系"
method: POST
path: "/menu/addMenuAuthority"
tags: ["AuthorityMenu"]
---

# 增加menu和角色关联关系

`POST /menu/addMenuAuthority`

## Request body

- RequestAddMenuAuthorityInfo
  - `authorityId` integer — 角色ID
  - `menus` SystemSysBaseMenu[]
    - `ID` integer — 主键ID
    - `authoritys` SystemSysAuthority[]
      - `authorityId` integer — 角色ID
      - `authorityName` string — 角色名
      - `children` SystemSysAuthority[]
      - `createdAt` string — 创建时间
      - `dataAuthorityId` SystemSysAuthority[]
      - `defaultRouter` string — 默认菜单(默认dashboard)
      - `deletedAt` string
      - `menus` SystemSysBaseMenu[]
      - `parentId` integer — 父角色ID
      - `updatedAt` string — 更新时间
    - `children` SystemSysBaseMenu[]
    - `component` string — 对应前端文件路径
    - `createdAt` string — 创建时间
    - `hidden` boolean — 是否在列表隐藏
    - `menuBtn` SystemSysBaseMenuBtn[]
      - `ID` integer — 主键ID
      - `createdAt` string — 创建时间
      - `desc` string
      - `name` string
      - `sysBaseMenuID` integer
      - `updatedAt` string — 更新时间
    - `meta` SystemMeta
      - `activeName` string
      - `closeTab` boolean — 自动关闭tab
      - `defaultMenu` boolean — 是否是基础路由（开发中）
      - `icon` string — 菜单图标
      - `keepAlive` boolean — 是否缓存
      - `title` string — 菜单名
    - `name` string — 路由name
    - `parameters` SystemSysBaseMenuParameter[]
      - `ID` integer — 主键ID
      - `createdAt` string — 创建时间
      - `key` string — 地址栏携带参数的key
      - `sysBaseMenuID` integer
      - `type` string — 地址栏携带参数为params还是query
      - `updatedAt` string — 更新时间
      - `value` string — 地址栏携带参数的值
    - `parentId` integer — 父菜单ID
    - `path` string — 路由path
    - `sort` integer — 排序标记
    - `updatedAt` string — 更新时间

## Response `200`

增加menu和角色关联关系

- object
  - `code` integer
  - `data` unknown
  - `msg` string

---

[API](https://skmtc.net/fisco-bcos/apis/gin-vue-admin-swagger-api.md) · [All operations](https://skmtc.net/fisco-bcos/apis/gin-vue-admin-swagger-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/fisco-bcos/gin-vue-admin-swagger-api/versions/83281ff551eb/schema)
