文 档 中 心 / Document Center
搜索 管理中心
壹川接口文档V3
获取指定职位的权限表
更新时间:2018-04-16 15:53:28   更新人员:叶洋   文档状态:完成 #148    测试接口
摘要
获取指定职位的权限表
  1. 接口基本信息
    接口名称:获取指定职位权限列表数据
    请求方法:GET
    接口地址:auth/poslts/:posid/:type
    登录验证:是
  2. 路由参数
    参数名 参数 数据类型 是否必须 示例值 说明
    type 获取职位的哪项权限 string api 可选值:api|menu
    posid 职位id int 职位id为整形数字
  3. 响应数据参数
    参数名 参数 数据类型 示例值 说明
    cansellst[] 可选列表 array 子集为组,组下面才是真实列表
    ├ @API部分[] ├ 下级为type=api时的返回参数 array 此项不是参数
    │ ├ group_id │ ├ 分组 int
    │ ├ group_name │ ├ 分组名 string
    │ └ group_list[] │ └ 分组下面的接口列表 array
    │   ├ id │   ├ 接口id int
    │   ├ title │   ├ 接口名称 string
    │   ├ must_login │   ├ 是否需要登录 string
    │   ├ sort │   ├ 排序值 int
    │   ├ status │   ├ 状态 int
    │   └ group_id │   └ 分组id int
    └ @MENU部分[] └ 下级为type=menu时的返回参数 array 此项不是参数
      ├ id   ├ 菜单id int
      ├ module   ├ 所属模块 string
      ├ hide   ├ 是否为隐藏菜单 int
      ├ pid   ├ 上级菜单 int
      ├ sort   ├ 排序 int
      ├ title   ├ 菜单名称 string
      ├ icon   ├ 图标 string
      ├ path   ├ 路径 string
      ├ remark   ├ 备注 string
      └ _child[]   └ 子级菜单列表 array 此项有下级菜单时才有,下级菜单参数说明与本级参数一致
    selecteds[] 选中项集合 arrayo 该值为一维数据,如[1,2,3]
  4. 请求示例
    请求例子(type=api):
     
    apirq('auth/poslts/:posid/:type', {
        data: {
            "posid": 2,
            "type": "api"
        },
        urlparams: [
            "posid",
            "type"
        ]
    }) 
    
    返回数据结果:
     
    {
        "code": 0,
        "msg": "ok",
        "time": "1523863474",
        "data": {
            "cansellst": [
                {
                    "group_id": 1,
                    "group_name": "公共接口库",
                    "group_list": [
                        {
                            "id": 18,
                            "title": "用户登录",
                            "must_login": 0,
                            "sort": 10,
                            "status": 1,
                            "group_id": 1
                        },
                        {
                            "id": 27,
                            "title": "退出当前登录用户",
                            "must_login": 1,
                            "sort": 1,
                            "status": 1,
                            "group_id": 1
                        },
                        {
                            "id": 67,
                            "title": "审核处理指定预约演示",
                            "must_login": 1,
                            "sort": 0,
                            "status": 1,
                            "group_id": 1
                        },
                        // ...
                    ]
                },
                {
                    "group_id": 3,
                    "group_name": "验证码类",
                    "group_list": [
                        {
                            "id": 1,
                            "title": "获取图片验证码",
                            "must_login": 0,
                            "sort": 0,
                            "status": 1,
                            "group_id": 3
                        }
                    ]
                },
                // ....
            ],
            "selecteds": [
                33,
                26
            ]
        }
    } 
    
    请求例子(type=menu):
     
    apirq('auth/poslts/:posid/:type', {
        data: {
            "posid": 2,
            "type": "menu"
        },
        urlparams: [
            "posid",
            "type"
        ]
    }) 
    
    返回数据结果:
     
    {
        "code": 0,
        "msg": "ok",
        "time": "1523863804",
        "data": {
            "cansellst": [
                {
                    "id": 1,
                    "module": "Admin",
                    "hide": 1,
                    "pid": 0,
                    "sort": 1,
                    "title": "控制台",
                    "icon": "",
                    "path": "/home/index",
                    "remark": ""
                },
                {
                    "id": 61,
                    "module": "Admin",
                    "hide": 1,
                    "pid": 0,
                    "sort": 2,
                    "title": "运营管理",
                    "icon": "",
                    "path": "/home/member",
                    "remark": "",
                    "_child": [
                        {
                            "id": 77,
                            "module": "Admin",
                            "hide": 1,
                            "pid": 61,
                            "sort": 0,
                            "title": "平台成员",
                            "icon": "",
                            "path": "/member/cpf",
                            "remark": ""
                        },
                        {
                            "id": 62,
                            "module": "Admin",
                            "hide": 1,
                            "pid": 61,
                            "sort": 1,
                            "title": "组织机构",
                            "icon": "",
                            "path": "/company/corg",
                            "remark": ""
                        },
                        // .......
                    ]
                },
                {
                    "id": 311,
                    "module": "Admin",
                    "hide": 1,
                    "pid": 0,
                    "sort": 3,
                    "title": "部门管理",
                    "icon": "",
                    "path": "/department/list",
                    "remark": "",
                    "_child": [
                        {
                            "id": 312,
                            "module": "Admin",
                            "hide": 1,
                            "pid": 311,
                            "sort": 1,
                            "title": "部门列表",
                            "icon": "",
                            "path": "/department/list",
                            "remark": ""
                        },
                        // ....
                    ]
                },
                // ........
            ],
            "selecteds": [
                1,
                61,
                62,
                63,
                64,
                65,
                77,
                311,
                312,
                314,
                315,
                118,
                117,
                66,
                67,
                68,
                69,
                70
            ]
        }
    } 
    
本书创建于 2018-03-30 12:03:13 ?如有疑问,请联系技术人员