获取当前用户所在团队的信息

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

接口说明

获取当前用户所在团队的信息
如需调用,请访问 开发者文档 来查看详细的接口使用说明
该接口仅开放给已获取SDK的开发者

API地址

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

是否需要登录

请求字段说明

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

响应字段说明

参数类型说明
idstring团队ID
uniquekeystring邀请码
remarksstring备注信息
createBystring创建者ID
createDatestring创建日期
updateBystring更新者ID
updateDatestring更新日期
teamNamestring团队名称
currentUserInfostring当前用户信息

响应成功示例

{
  "code": 0,
  "data": {
    "id": "75e2421beb814051a098764372c9be78",
    "uniquekey": "769501600a2f41dbaa64ef7c52fc6ca6",
    "remarks": null,
    "createBy": "935d6c5569e14f8fbb8d9c0e088fa66a",
    "createDate": "2019-12-12 16:17:23",
    "updateBy": "935d6c5569e14f8fbb8d9c0e088fa66a",
    "updateDate": "2019-12-12 16:17:23",
    "teamName": "test01的团队",
    "currentUserInfo": {
      "id": "3f4c3c6ce53347a489615cf7cac3070e",
      "remarks": null,
      "roleId": null,
      "teamId": "75e2421beb814051a098764372c9be78",
      "applyMessage": null,
      "createBy": "935d6c5569e14f8fbb8d9c0e088fa66a",
      "createDate": "2019-12-12 16:17:23",
      "currentTeam": "1",
      "updateBy": "935d6c5569e14f8fbb8d9c0e088fa66a",
      "updateDate": "2019-12-12 16:49:55",
      "userId": "935d6c5569e14f8fbb8d9c0e088fa66a",
      "verify": "1",
      "loginName": null,
      "realName": null,
      "sex": null,
      "mobile": null,
      "email": null,
      "lastLoginDate": null,
      "photo": null,
      "roleName": null
    }
  },
  "message": "成功"
}

响应失败示例

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

响应接受类型

application/json

响应状态码

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

示例代码

$.ajax({

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

    type: 'GET',

    data: '',

    dataType: 'text',

    cache: false,

    contentType: 'application/json',

    xhrFields: {

        withCredentials: true

    },

    crossDomain: true,

    success:function(data){

        // 成功返回值

    },

    error:function(XMLHttpRequest, textStatus, errorThrown){

    

    }

})