Explorar o código

feat: 解决上传获取不到平台id 的问题

Damon hai 7 meses
pai
achega
1744e16072
Modificáronse 2 ficheiros con 5 adicións e 4 borrados
  1. 3 3
      src/components/Upload/index.vue
  2. 2 1
      src/views/music/list/index.vue

+ 3 - 3
src/components/Upload/index.vue

@@ -165,14 +165,14 @@ export default {
     this.action = this.obj[this.listType];
     // 回显图片
     this.form.file = this.url;
-    var platformId = this.$props.platformId;
-    this.form.platformId = this.$props.platformId;
-    this.data.platformId = this.$props.platformId;
   },
 
   methods: {
     // 上传之前
     async beforeUpload(file) {
+      var platformId = this.$props.platformId;
+      this.form.platformId = platformId;
+      this.data.platformId = platformId;
       if (this.width && this.height) {
         const data = await this.readerImg(file);
         let _width =

+ 2 - 1
src/views/music/list/index.vue

@@ -212,7 +212,7 @@
           @click="getSubmit"
           listType="mp3"
           multiple
-          :platformId="form.platformId"
+          :platformId="this.form.platformId"
           name="multipartFiles"
           style="margin-left: 10px"
           @upload="uploadSucceed()"
@@ -271,6 +271,7 @@ export default {
   methods: {
     uploadSucceed(e) {
       this.dialogVisible = false;
+      this.getList();
     },
 
     getInputClose() {