浏览代码

增加修改时的附件处理

zhy 1 天之前
父节点
当前提交
9bd490a125
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/views/cms/post.vue

+ 2 - 1
src/views/cms/post.vue

@@ -148,7 +148,8 @@ export default {
       await this.selectFileQuery();
       const res = await cmsFetch('_' + e[`${this.mydata.classify}Id`], this.mydata.type);
       if (res.code == 200) {
-        this.mydata.formData = { ...res.data, url: res.data.image, topStatus: String(res.data.topStatus) };
+        const urls = res.data.attachments.map(e => e.url)
+        this.mydata.formData = { ...res.data, url: res.data.image, topStatus: String(res.data.topStatus), urls: String(urls) };
         for (const key in this.mydata.formData.meta) {
           this.mydata.formData[`meta.${key}`] = this.mydata.formData.meta[key]
         }