钉钉企业第三方应用,JSAPI鉴权无效的agentid
已解决, 钉钉第三方企业内部微应用,鉴权方式agentId换成appId, 官方文档中并没有说明,有点坑。
// ======== JSAPI 鉴权 ======
export const authJsApi = corpId => {
return new Promise((resolve, reject) => {
axios.request({
url: `/ding-service/jsapi-auth/${corpId}`,
method: 'get',
}).then(res=> {
let { agentId, timeStamp, nonceStr, signature, type, jsApiList } = res.data;
console.log(agentId)
dd.ready(()=>{
dd.config({ appId:agentId, corpId, timeStamp, nonceStr, signature, jsApiList:['biz.contact.complexPicker'], type: 0, });
})
resolve()
}).catch(err=> reject(err) );
});
}
赞0
踩0