api为wecom-jssdk
前端项目框架用的是angularJS v16。
js注册代码如下
async ngOnInit(): Promise<void> {
console.log('初始化')
//获取企业微信JS鉴权数据
await axios.get('https://api.m6.minbon.com/api/wx/jsApiTicket/encode').then(res=>{
const signature = res.data.data.signature;
const timestamp = res.data.data.timeStamp;
const nonceStr = res.data.data.nonceStr;
this.signature = signature;
this.timestamp = timestamp;
this.nonceStr = nonceStr;
})
//声明数据
let signature = this.signature; //赋值签名
let timestamp = this.timestamp; //赋值时间戳
let nonceStr = this.nonceStr; //赋值16位随机字符串
//企业微信JS鉴权
wx.register({
corpId:'ww3caac0bda5da5abb',
jsApiList:['openUserProfile','selectExternalContact'],
async getConfigSignature(){
return { timestamp, nonceStr, signature }
},
onConfigSuccess(){
console.log('成功')
},
onConfigFail(){
console.log('失败')
}
上线后回调没有任何翻译,打印不出任何信息
企业微信的问题建议到企业微信开发者中心提问:https://developer.work.weixin.qq.com/community/question