diff --git a/src/apps/AppCooperationPropaganda/massDispatch.vue b/src/apps/AppCooperationPropaganda/massDispatch.vue index f86fe448..f6bfe193 100644 --- a/src/apps/AppCooperationPropaganda/massDispatch.vue +++ b/src/apps/AppCooperationPropaganda/massDispatch.vue @@ -141,50 +141,42 @@ export default { toSend() { // 文本 - let text = {} - if(this.content.length) { - text = { - content: this.content - } + const text = { + content: this.content } const data = [] // 图片 - if(this.picList.length) { - const imgs = this.picList.map(v =>{ - return { - msgtype: "image", - image: { - mediaid: v.mediaId, - imgUrl: v.imgPicUrl, - }, - } - }) - data.push(imgs) - } + const imgs = this.picList.map(v =>{ + return { + msgtype: "image", + image: { + mediaid: v.mediaId, + imgUrl: v.imgPicUrl, + }, + } + }) + data.push(imgs) // 视频 - if(this.videoList.length) { - const videos = this.videoList.map(v =>{ - return { - msgtype: "video", - video:{ - mediaid: v.mediaId, - }, - } - }) - data.push(videos) - } + const videos = this.videoList.map(v =>{ + return { + msgtype: "video", + video:{ + mediaid: v.mediaId, + }, + } + }) + data.push(videos) // 文件 - if(this.fileList.length) { - const files = this.fileList.map(v => { - return { - msgtype: "file", - file:{ - mediaid: v.mediaId, - }, - } - }) - data.push(files) - } + const files = this.fileList.map(v => { + return { + msgtype: "file", + file:{ + mediaid: v.mediaId, + }, + } + }) + data.push(files) + // 链接 // const links = this.webpage.map(v =>{ // return { @@ -197,8 +189,9 @@ export default { // }, // } // }) + this.shareToExternalChat({ ...text, attachments: data }).then((res) =>{ - console.log(res, '返回的数据'); + console.log(res,'返回的数据'); }) }, },