简要描述:
- 权限管理-用户权限获取
接口版本:
版本号 | 制定人 | 制定日期 | 修订日期 |
---|---|---|---|
v3 | 陈碧贵 | 2019-01-20 | xxxx-xx-xx |
请求URL:
http://{url参数}/bo/api/v3/bo-popedom/list/res/popedom-user?objectId=insured&objectType=[2,3]&_nodejs=common-data
请求方式:
- GET
请求头:
参数名 | 是否必须 | 类型 | 说明 |
---|---|---|---|
XownerId | 是 | string | 项目唯一ID,对应bo_project {ownerId} |
XsysId | 否 | string | 所属系统 对应 bo_system 表 |
XuserFromFirstShareId | string | 否 | 一级分享用户ID, bo_user user_id |
XuserFromSecondShareId | string | 否 | 二级分享用户ID, bo_user user_id |
XverifyApi | 是 | string | 加密规则encryptByDES(`${newGuid()} |
XfilterAreaCode | 否 | string | 行政区编码, 对应 bo_sys_area area_code |
Content-Type: | 是 | string | application/json; charset=utf-8 请求类型 |
Authorization | 是 | string | 当前用户认证信息,通过登录接口获取 Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6 |
请求参数:
参数名 | 是否必须 | 类型 | 说明 |
---|---|---|---|
objectId | 是 | string | 用户ID,对应userId |
objectType | 是 | string | 2 表示用户新增的权限 3 表示用户删除的权限 |
_nodejs | 是 | string | common-data 对应/Config/AppNodeJs/Plugins/fn- common-data.js, 通过nodejs插件,对响应结果进行二次处理 common-data 普通数据(小写驼峰)common-data-under 普通数据下划线 |
返回示例:
正确时返回:
{
data: [
{
popId: "rg-deve-rg-20200-3cb1579e-294d-434f",
menuId: "bt-deve-bt-20200-d26dbebe-369e-4d67",
objectType: "1",
objectId: "insured",
mfId: "bt-deve-bt-20200-d1e294ab-09ce-4fec",
diffTableNo: 0,
},
{
popId: "rg-deve-rg-20200-3cb1579e-294d-434f",
menuId: "bt-deve-bt-20200-d26dbebe-369e-4d67",
objectType: "2",
objectId: "insured",
mfId: "bt-deve-bt-20200-d1e294ab-09ce-4fec",
diffTableNo: 0,
},
{
popId: "rg-deve-rg-20200-3cb1579e-294d-434f",
menuId: "bt-deve-bt-20200-d26dbebe-369e-4d67",
objectType: "3",
objectId: "insured",
mfId: "bt-deve-bt-20200-d1e294ab-09ce-4fec",
diffTableNo: 0,
},
{
popId: "rg-deve-rg-20200-3cb1579e-294d-434f",
menuId: "bt-deve-bt-20200-d26dbebe-369e-4d67",
objectType: "4",
objectId: "insured",
mfId: "bt-deve-bt-20200-d1e294ab-09ce-4fec",
diffTableNo: 0,
},
{
popId: "rg-deve-rg-20200-3cb1579e-294d-434f",
menuId: "bt-deve-bt-20200-d26dbebe-369e-4d67",
objectType: "5",
objectId: "insured",
mfId: "bt-deve-bt-20200-d1e294ab-09ce-4fec",
diffTableNo: 0,
}
],
code: 0,
success: true,
}
错误时返回:
{
"code": 0,
"message": ""
"error":{
errorCode:null,
errorText:null
}
"success": false,
}
返回参数说明:
参数名 | 类型 | 说明 |
---|---|---|
success | bool | true 表示数据请求成功(跟code=0一致),调用者优先使用 |
code | int | true 表示数据请求成功(跟code=0一致),调用者优先使用 |
data | array | popId: 权限表主键ID menuId: 栏目ID objectType: “1、2、3、4、5”, 角色、用户新增、用户删除、机构、职位 objectId: 用户ID mfId: 栏目和功能关系表ID |
cacheType | string | redis/sqlite/local 数据来源缓存 的类型(便于开发调试和性能优化) |
cacheDate | date | 最后数据获取时间 |
SQL
set @menuId='11';
set @objectType=2;
select * from ( select pop_id,menu_id,object_type,object_id,mf_id from bo_popedom where object_id=@objectId and (object_type=2) and checked=1 union select pop_id,menu_id,object_type,object_id,mf_id from bo_popedom where object_id in (select role_id from bo_user_role where user_id=@objectId) and object_type=1 and checked=1 union select pop_id,menu_id,object_type,object_id,mf_id from bo_popedom where object_id in (select dep_id from bo_user_dep where user_id=@objectId) and object_type=4 and checked=1 union select pop_id,menu_id,object_type,object_id,mf_id from bo_popedom where object_id in (select job_id from bo_user_job where user_id=@objectId) and object_type=5 and checked=1 ) t where (concat(menu_id,mf_id)) not in (select concat(menu_id,mf_id) from bo_popedom where object_id=@objectId and object_type=3)
文档更新时间: 2022-08-29 08:09 作者:admin