https://ios-sns-public-cos-1251001049.cos.ap-guangzhou.myqcloud.com/robot/interview_table_5.png
这个图片显示不出来,以前用shell调用发送可以,我改用axios这种就不行了
let postRequest = (url, data) => {
let headers = {
'Content-Type': 'application/json',
}
return axios.post(url, data, {headers: headers})
.then((res) => {
console.log('[message send res1:]', JSON.stringify(res));
}).catch((err) => {
console.log('[message send err:]', JSON.stringify(err));
});}
参数data:
{"msgtype":"news","news":{"articles":[{"title":"tt","description":"tt","url":"https://www.baidu.com","pic_url":"https://ios-sns-public-cos-1251001049.cos.ap-guangzhou.myqcloud.com/robot/interview_table_5.png"}]}}
url为机器人地址
调用后企业微信中显示的效果为
你好,测试了下这个picurl是正常,发送可以正常显示图片,应该是代码存在问题,可以先检查下
let headers = {
'Content-Type': 'application/json',
}
return axios.post(url, data, {headers: headers})
.then((res) => {
console.log('[message send res1:]', JSON.stringify(res));
}).catch((err) => {
console.log('[message send err:]', JSON.stringify(err));
});
let data = {
'msgtype': 'news',
'news': {
'articles': [
{
'title': params.msg_title,
'description': params.msg_sub_title,
'url': params.msg_url,
'pic_url': params.msg_pic_url,
}
]
}
};