目录
兼容性:企业微信 4.0.8 开始支持
页面在上下游聊天工具栏中打开时,获取当前上下游联系人用户 ID。
ww.getCurCorpGroupContact()
仅支持上下游聊天工具栏中进入的页面调用,即 getContext 返回 entry
为 chain_single_chat_tools
或 chain_group_chat_tools
的场景
本接口必须使用应用身份进行注册
当前成员必须在应用的可见范围
属性 | 类型 | 必填 | 说明 | |
---|---|---|---|---|
success | Function | 否 | 成功回调 | |
fail | Function | 否 | 失败回调 | |
cancel | Function | 否 | 取消回调 | |
complete | Function | 否 | 完成回调 |
Promise<Object>
属性 | 类型 | 必填 | 说明 | |
---|---|---|---|---|
errMsg | string | 是 | 通用错误信息 | |
errCode | number | 是 | 通用错误码 | |
corpId | string | 是 | 当前联系人的企业 ID | |
userId | string | 是 | 当前联系人用户 ID |
errMsg | 说明 |
---|---|
getCurCorpGroupContact:ok | 执行成功 |
getCurCorpGroupContact:no permission | 应用身份鉴权失败 |
getCurCorpGroupContact:without context of corpgroup contact | 当前页面入口不支持调用 |
wx.invoke('getCurCorpGroupContact', {}, function(res) {
if (res.err_msg == 'getCurCorpGroupContact:ok') {
corpId = res.corpId // 返回当前联系人的企业corpId
userId = res.userId // 返回当前联系人userId
} else {
// 错误处理
}
})