diff --git a/yudao-ui-admin/src/views/mp/components/wx-editor/WxEditor.vue b/yudao-ui-admin/src/views/mp/components/wx-editor/WxEditor.vue index 35dedf5dc..4f2f0256d 100644 --- a/yudao-ui-admin/src/views/mp/components/wx-editor/WxEditor.vue +++ b/yudao-ui-admin/src/views/mp/components/wx-editor/WxEditor.vue @@ -1,6 +1,8 @@ <!-- - Copyright (C) 2018-2019 - All rights reserved, Designed By www.joolun.com + 芋道源码: + ① 调整 uploadData 属性,只需要传入 accountId 即可 --> <template> <div id="wxEditor"> @@ -44,14 +46,16 @@ import { getAccessToken } from "@/utils/auth"; export default { props: { - uploadData: { - type: Object + /* 公众号账号编号 */ + accountId: { + type: Number, + required: true }, - /*编辑器的内容*/ + /* 编辑器的内容 */ value: { type: String }, - /*图片大小*/ + /* 图片大小 */ maxSize: { type: Number, default: 4000 // kb @@ -97,6 +101,10 @@ export default { }, actionUrl: process.env.VUE_APP_BASE_API +'/admin-api/mp/material/upload-news-image', // 这里写你要上传的图片服务器地址 headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部 + uploadData: { + "type": 'image', // TODO 芋艿:试试要不要换成 thumb + "accountId": this.accountId, + }, } }, methods: { diff --git a/yudao-ui-admin/src/views/mp/draft/index.vue b/yudao-ui-admin/src/views/mp/draft/index.vue index 72162934f..3678320eb 100644 --- a/yudao-ui-admin/src/views/mp/draft/index.vue +++ b/yudao-ui-admin/src/views/mp/draft/index.vue @@ -117,7 +117,7 @@ SOFTWARE. <div class="right" v-loading="addMaterialLoading" v-if="articlesAdd.length > 0"> <!--富文本编辑器组件--> <el-row> - <wx-editor v-model="articlesAdd[isActiveAddNews].content" :uploadData="uploadData" + <wx-editor v-model="articlesAdd[isActiveAddNews].content" :account-id="this.uploadData.accountId" v-if="hackResetEditor"/> </el-row> <br><br><br><br> @@ -204,9 +204,7 @@ export default { fileList: [], uploadData: { "type": 'image', // TODO 芋艿:试试要不要换成 thumb - "title": '', - "introduction": '', - "accountId": 1, + // "accountId": 1, }, // ========== 草稿新建 or 修改 ========== @@ -495,8 +493,6 @@ export default { // 重置上传文件的表单 this.fileList = [] - this.uploadData.title = '' - this.uploadData.introduction = '' // 设置草稿的封面字段 this.articlesAdd[this.isActiveAddNews].thumbMediaId = response.data.mediaId