简要描述:

  • 所有的权限信息,便于pwa推送(通常用户登录后获取)

  • 获取当前用户允许访问和操作的栏目(获取后可缓存到本地)

接口版本:

版本号 制定人 制定日期 修订日期
v3 陈碧贵 2019-01-20 xxxx-xx-xx

请求URL:

请求方式:

  • 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

请求参数:



参数名 是否必须 类型 说明
_nodejs string common-data 对应/Config/AppNodeJs/Plugins/fn- common-data.js, 通过nodejs插件,对响应结果进行二次处理 common-data 普通数据(小写驼峰)common-data-under 普通数据下划线

返回示例:

正确时返回:

{
    "data": [
        {
            "id": "3985768390017945600",
            "meta": {
                "mkey": "mall-business",
                "field": "manager",
                "moulesShow": [
                    "table",
                    "action"
                ],
                "modulesHide": [
                    "form"
                ],
                "position": "tab",
                "class": "el-icon-unlock",
                "menuClass": "nav-menu__all",
                "attrs": {
                    "label": "市场管理"
                },
                "popup": {
                    "component": "bs-table"
                },
                "tab": {
                    "component": "bs-table"
                }
            },
            "position": "nav-content,nav-more",
            "actions": [
                {
                    "funcId": "add",
                    "menuId": "3985768390017945600",
                    "mfId": "3985768390017945600-add",
                    "funcName": "新增",
                    "diffTableNo": 1
                },
                {
                    "funcId": "del",
                    "menuId": "3985768390017945600",
                    "mfId": "3985768390017945600-del",
                    "funcName": "删除",
                    "diffTableNo": 1
                },
                {
                    "funcId": "detail",
                    "menuId": "3985768390017945600",
                    "mfId": "3985768390017945600-detail",
                    "funcName": "明细",
                    "diffTableNo": 1
                },
                {
                    "funcId": "edit",
                    "menuId": "3985768390017945600",
                    "mfId": "3985768390017945600-edit",
                    "funcName": "修改",
                    "diffTableNo": 1
                },
                {
                    "funcId": "export",
                    "menuId": "3985768390017945600",
                    "mfId": "3985768390017945600-export",
                    "funcName": "导出",
                    "diffTableNo": 1
                },
                {
                    "funcId": "history",
                    "menuId": "3985768390017945600",
                    "mfId": "3985768390017945600-history",
                    "funcName": "操作记录",
                    "diffTableNo": 1
                },
                {
                    "funcId": "import",
                    "menuId": "3985768390017945600",
                    "mfId": "3985768390017945600-import",
                    "funcName": "导入",
                    "diffTableNo": 1
                },
                {
                    "funcId": "refresh",
                    "menuId": "3985768390017945600",
                    "mfId": "3985768390017945600-refresh",
                    "funcName": "刷新",
                    "diffTableNo": 1
                },
                {
                    "funcId": "save",
                    "menuId": "3985768390017945600",
                    "mfId": "3985768390017945600-save",
                    "funcName": "保存",
                    "diffTableNo": 1
                },
                {
                    "funcId": "search",
                    "menuId": "3985768390017945600",
                    "mfId": "3985768390017945600-search",
                    "funcName": "查询",
                    "diffTableNo": 1
                }
            ],
            "fields": [
                {
                    "field": "address",
                    "popedom": 1,
                    "menuId": "3985768390017945600",
                    "diffTableNo": 1
                },
                {
                    "field": "area_code",
                    "popedom": 1,
                    "menuId": "3985768390017945600",
                    "diffTableNo": 1
                },
                {
                    "field": "audit_date",
                    "popedom": 1,
                    "menuId": "3985768390017945600",
                    "diffTableNo": 1
                },
                {
                    "field": "audit_status",
                    "popedom": 1,
                    "menuId": "3985768390017945600",
                    "diffTableNo": 1
                },
                {
                    "field": "audit_user_id",
                    "popedom": 1,
                    "menuId": "3985768390017945600",
                    "diffTableNo": 1
                },
                {
                    "field": "business_id",
                    "popedom": 2,
                    "menuId": "3985768390017945600",
                    "diffTableNo": 1
                },
                {
                    "field": "business_name",
                    "popedom": 1,
                    "menuId": "3985768390017945600",
                    "diffTableNo": 1
                },
                {
                    "field": "create_user_id",
                    "popedom": 1,
                    "menuId": "3985768390017945600",
                    "diffTableNo": 1
                },
                {
                    "field": "img_url",
                    "popedom": 9,
                    "menuId": "3985768390017945600",
                    "diffTableNo": 1
                },
                {
                    "field": "is_enabled",
                    "popedom": 1,
                    "menuId": "3985768390017945600",
                    "diffTableNo": 1
                },
                {
                    "field": "modify_date",
                    "popedom": 1,
                    "menuId": "3985768390017945600",
                    "diffTableNo": 1
                },
                {
                    "field": "modify_user_id",
                    "popedom": 1,
                    "menuId": "3985768390017945600",
                    "diffTableNo": 1
                },
                {
                    "field": "opinion",
                    "popedom": 9,
                    "menuId": "3985768390017945600",
                    "diffTableNo": 1
                }
            ],
            "popedoms": [
                {
                    "popId": "3967533351555829760",
                    "mapperField": "basis|bbs-comment|manager",
                    "mfId": "3965410558294888448-add",
                    "menuId": "3965410558294888448",
                    "isEnabled": 1,
                    "funcId": "add",
                    "diffTableNo": 1
                },
                {
                    "popId": "3967533351652298752",
                    "mapperField": "basis|bbs-comment|manager",
                    "mfId": "3965410558294888448-edit",
                    "menuId": "3965410558294888448",
                    "isEnabled": 1,
                    "funcId": "edit",
                    "diffTableNo": 1
                },
                {
                    "popId": "3967533351744573440",
                    "mapperField": "basis|bbs-comment|manager",
                    "mfId": "3965410558294888448-del",
                    "menuId": "3965410558294888448",
                    "isEnabled": 1,
                    "funcId": "del",
                    "diffTableNo": 1
                },
                {
                    "popId": "3967533351849431040",
                    "mapperField": "basis|bbs-comment|manager",
                    "mfId": "3965410558294888448-detail",
                    "menuId": "3965410558294888448",
                    "isEnabled": 1,
                    "funcId": "detail",
                    "diffTableNo": 1
                },
                {
                    "popId": "3967533351950094336",
                    "mapperField": "basis|bbs-comment|manager",
                    "mfId": "3965410558294888448-import",
                    "menuId": "3965410558294888448",
                    "isEnabled": 1,
                    "funcId": "import",
                    "diffTableNo": 1
                },
                {
                    "popId": "3967533352046563328",
                    "mapperField": "basis|bbs-comment|manager",
                    "mfId": "3965410558294888448-export",
                    "menuId": "3965410558294888448",
                    "isEnabled": 1,
                    "funcId": "export",
                    "diffTableNo": 1
                },
                {
                    "popId": "3967533352143032320",
                    "mapperField": "basis|bbs-comment|manager",
                    "mfId": "3965410558294888448-save",
                    "menuId": "3965410558294888448",
                    "isEnabled": 1,
                    "funcId": "save",
                    "diffTableNo": 1
                },
                {
                    "popId": "3967533352428244992",
                    "mapperField": "basis|bbs-comment|manager",
                    "mfId": "3965410558294888448-history",
                    "menuId": "3965410558294888448",
                    "isEnabled": 1,
                    "funcId": "history",
                    "diffTableNo": 1
                },
                {
                    "popId": "3967533352524713984",
                    "mapperField": "basis|bbs-comment|manager",
                    "mfId": "3965410558294888448-search",
                    "menuId": "3965410558294888448",
                    "isEnabled": 1,
                    "funcId": "search",
                    "diffTableNo": 1
                },
                {
                    "popId": "3967533352633765888",
                    "mapperField": "basis|bbs-comment|manager",
                    "mfId": "3965410558294888448-refresh",
                    "menuId": "3965410558294888448",
                    "isEnabled": 1,
                    "funcId": "refresh",
                    "diffTableNo": 1
                }
            ],
            "menuId": "3965410558294888448",
            "menuName": "帖子评论",
            "isEnabled": 1,
            "parentId": "bbs-center",
            "diffTableNo": 0
        }
    ],
    "code": "0",
    "retCode": "0",
    "success": true
}
  • popedoms:当前用户拥有的所有功能,funcId 对应 actions里面id,如果没有值,表示无权访问
  • actions: 栏目底下已配置的所有功能
  • fields: 栏目底下拥有的字段(如果有配置,结合/bo/api/v3/bridge/bo-user/res/polymerization使用)

错误时返回:

{
    "code": 0,
    "message": ""
    "error":{
      errorCode:null,
      errorText:null
    }
    "success": false,
}

返回参数说明:

参数名 类型 说明
success bool true 表示数据请求成功(跟code=0一致),调用者优先使用
code int true 表示数据请求成功(跟code=0一致),调用者优先使用
data object Meta Position 控制栏目显示的区域 Actions 功能栏目拥有的功能权限 Component 控制栏目容器里面显示的组件内容
cacheType string redis/sqlite/local 数据来源缓存 的类型(便于开发调试和性能优化)
cacheDate date 最后数据获取时间

detailPosition 等用于扩展自定义组件情况,直接跳转

      detailPosition:"popup",
              detailPopup: { component: "bs-table" },
              detailTab: { component: "bs-table" },

详情页面跳转

 handleToDetial(item) {
      let that = this;
      let menuT = JSON.parse(JSON.stringify(that.value));
      if(!menuT.meta.detailPosition||(!menuT.meta.detailPopup&&!menuT.meta.detailTab)){
        that.$msgBox.error("meta.detailPosition/detailPopup/detailTab未配置");
        return;
      }      
      menuT.meta.position = menuT.meta.detailPosition;
      menuT.meta.popup = menuT.meta.detailPopup;
      menuT.meta.tab = menuT.meta.detailTab;
      mainContentNav.changeMenuRight(this, menuT, false);
    },

栏目跳转


import mainContentNav from "@/components/basis/main-content-nav/method";


 handelChangeMenu(item) {
      mainContentNav.changeMenuRight(this, item, false);
    },

bo-ajax-html 远程html获取 {approot} {cdn}

1、remote-xpath详见query版本
https://www.cnblogs.com/Flylater/p/10438302.html

{
    "mkey": "bo-ajax-html",
    "field": "manager",
    "moulesShow": [
        "table",
        "action"
    ],
    "modulesHide": [
        "form"
    ],
    "position": "tab",
    "class": "el-icon-unlock",
    "menuClass": "nav-menu__all",
    "attrs": {
        "remote-url": "{approot}/page-components/icon-line.html",
        "remote-js": "{approot}/page-components/demo.js",
        "remote-xpath": "",
        "label": "我的收藏",
        "row-primary-key": "label"
    },
    "popup": {
        "component": "bo-ajax-html"
    },
    "tab": {
        "component": "bo-ajax-html"
    }
}
文档更新时间: 2022-08-29 08:09   作者:admin