Browse Source

增加修改时的附件处理

zhy 1 day ago
parent
commit
9bd490a125
1 changed files with 2 additions and 1 deletions
  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]
         }