获取团队可配置权限信息

优质
小牛编辑
136浏览
2023-12-01

接口说明

获取团队可配置权限信息
如需调用,请访问 开发者文档 来查看详细的接口使用说明
该接口仅开放给已获取SDK的开发者
如开启https功能,请求地址的协议应改为https,如:https://www.example.com/wish3dearth/api/access/v1.0.0/getLicenseInfo

API地址

GET /permissions/api/team/v1.0.0/getTeamPermissions

是否需要登录

请求字段说明

参数类型请求类型是否必须说明
tokenstringheader当前登录用户的TOKEN

响应字段说明

参数类型说明
belongTostring
codestring权限唯一标识
configShowstring是否显示
iconstring图标
idstring图标
namestring权限名称
parentIdstring父权ID
permsstring参数
sortstring排序
teamAdminShowstring
typestring
urlstring

响应成功示例

{
  "code": 0,
  "data": [
    {
      "belongTo": "1",
      "code": "SCENE_DATA_VISIBLE",
      "configShow": "1",
      "icon": "layui-icon-app",
      "id": "11",
      "name": "场景",
      "parentId": "0",
      "perms": "earth:scene:list,earth:access:limit",
      "sort": 2,
      "teamAdminShow": "0",
      "type": "1",
      "url": ""
    },
    {
      "belongTo": "1",
      "code": "DATA_DATA_VISIBLE",
      "configShow": "1",
      "icon": "layui-icon-template-1",
      "id": "12",
      "name": "素材",
      "parentId": "0",
      "perms": "earth:material:list,earth:access:limit",
      "sort": 3,
      "teamAdminShow": "0",
      "type": "1",
      "url": ""
    },
    {
      "belongTo": "1",
      "code": "TEAM_DATA_VISIBLE",
      "configShow": "1",
      "icon": "layui-icon-group",
      "id": "13",
      "name": "团队",
      "parentId": "0",
      "perms": "team:team:info",
      "sort": 4,
      "teamAdminShow": "0",
      "type": "1",
      "url": ""
    },
    {
      "belongTo": "1",
      "code": "SCENE_DATA_LOOK",
      "configShow": "1",
      "icon": null,
      "id": "15",
      "name": "预览场景",
      "parentId": "11",
      "perms": "earth:scene:info,earth:shp:setStyle,earth:material:info",
      "sort": 6,
      "teamAdminShow": "0",
      "type": "3",
      "url": ""
    },
    {
      "belongTo": "1",
      "code": "SCENE_DATA_CREATE",
      "configShow": "1",
      "icon": null,
      "id": "16",
      "name": "创建场景",
      "parentId": "11",
      "perms": "earth:scene:save,earth:scene:add,earth:marker:list",
      "sort": 7,
      "teamAdminShow": "0",
      "type": "3",
      "url": ""
    },
    {
      "belongTo": "1",
      "code": "SCENE_DATA_EDIT",
      "configShow": "1",
      "icon": null,
      "id": "17",
      "name": "编辑场景",
      "parentId": "11",
      "perms": "earth:scene:save,earth:scene:edit,earth:marker:list",
      "sort": 8,
      "teamAdminShow": "0",
      "type": "3",
      "url": ""
    },
    {
      "belongTo": "1",
      "code": "SCENE_SHARE_CONFIG",
      "configShow": "1",
      "icon": null,
      "id": "18",
      "name": "我的分享",
      "parentId": "11",
      "perms": "earth:sceneShare:list,earth:sceneShare:add,earth:sceneShare:edit,earth:sceneShare:delete",
      "sort": 9,
      "teamAdminShow": "0",
      "type": "3",
      "url": ""
    },
    {
      "belongTo": "1",
      "code": "SCENE_DATA_DELETE",
      "configShow": "1",
      "icon": null,
      "id": "19",
      "name": "删除场景",
      "parentId": "11",
      "perms": "earth:scene:delete",
      "sort": 10,
      "teamAdminShow": "0",
      "type": "3",
      "url": ""
    },
    {
      "belongTo": "1",
      "code": "DATA_DATA_LOOK",
      "configShow": "1",
      "icon": null,
      "id": "20",
      "name": "预览素材",
      "parentId": "12",
      "perms": "earth:material:info",
      "sort": 11,
      "teamAdminShow": "0",
      "type": "3",
      "url": ""
    },
    {
      "belongTo": "1",
      "code": "DATA_DATA_CREATE",
      "configShow": "1",
      "icon": null,
      "id": "21",
      "name": "发布素材",
      "parentId": "12",
      "perms": "earth:oss:addMaterial,earth:upload:addMaterial,earth:serverupload:list,earth:serverupload:info,earth:serverupload:save",
      "sort": 12,
      "teamAdminShow": "0",
      "type": "3",
      "url": ""
    },
    {
      "belongTo": "1",
      "code": "DATA_DATA_EDIT",
      "configShow": "1",
      "icon": null,
      "id": "22",
      "name": "编辑素材",
      "parentId": "12",
      "perms": "earth:material:edit",
      "sort": 13,
      "teamAdminShow": "0",
      "type": "3",
      "url": ""
    },
    {
      "belongTo": "1",
      "code": "DATA_DATA_DELETE",
      "configShow": "1",
      "icon": null,
      "id": "23",
      "name": "删除素材",
      "parentId": "12",
      "perms": "earth:material:deleteAll",
      "sort": 14,
      "teamAdminShow": "0",
      "type": "3",
      "url": ""
    },
    {
      "belongTo": "1",
      "code": "TEAM_DATA_USER",
      "configShow": "1",
      "icon": null,
      "id": "24",
      "name": "成员管理",
      "parentId": "13",
      "perms": "team:team:invite,team:user:list,team:user:info,team:user:verify,team:user:edit,team:user:delete,team:role:list,team:team:info,team:role:info",
      "sort": 15,
      "teamAdminShow": "0",
      "type": "3",
      "url": ""
    }
  ],
  "message": "成功"
}

响应失败示例

{
  "code": 500,
  "message": "未知错误,请及时联系管理人员进行处理"
}

响应接受类型

application/json

响应状态码

HTTP状态码原因
0成功
200OK
401Unauthorized
403Forbidden
404Not Found
10000token不能为空
10001token已失效,请重新登录
15015团队信息错误
15017团队邀请码为空
99998非法请求
99999服务器异常

示例代码

$.ajax({

    url: '/permissions/api/team/v1.0.0/getTeamPermissions?token=',

    type: 'GET',

    data: '',

    dataType: 'text',

    cache: false,

    contentType: 'application/json',

    xhrFields: {

        withCredentials: true

    },

    crossDomain: true,

    success:function(data){

        // 成功返回值

    },

    error:function(XMLHttpRequest, textStatus, errorThrown){

    

    }

})