wangyang 5 anos atrás
pai
commit
6f2d7570fa

+ 8 - 6
src/components/Dropzone/index.vue

@@ -192,19 +192,21 @@
         if (!val) return
         if (Array.isArray(val)) {
           val.map((v, i) => {
-            const fileUrl = `${process.env.VUE_APP_BASE_API}/api/files/view-file?path=${v}`
-            const mockFile = { url: fileUrl }
+            // const fileUrl = `${process.env.VUE_APP_BASE_API}/api/files/view-file?path=${v}`
+            // const mockFile = { url: fileUrl }
+            const mockFile = { url: v }
             this.dropzone.options.addedfile.call(this.dropzone, mockFile)
-            this.dropzone.options.thumbnail.call(this.dropzone, mockFile, fileUrl)
+            this.dropzone.options.thumbnail.call(this.dropzone, mockFile, v)
             mockFile.previewElement.classList.add('dz-success')
             mockFile.previewElement.classList.add('dz-complete')
             return true
           })
         } else {
-          const fileUrl = `${process.env.VUE_APP_BASE_API}/api/files/view-file?path=${val}`
-          const mockFile = { url: fileUrl }
+          // const fileUrl = `${process.env.VUE_APP_BASE_API}/api/files/view-file?path=${val}`
+          // const mockFile = { url: fileUrl }
+          const mockFile = { url: val }
           this.dropzone.options.addedfile.call(this.dropzone, mockFile)
-          this.dropzone.options.thumbnail.call(this.dropzone, mockFile, fileUrl)
+          this.dropzone.options.thumbnail.call(this.dropzone, mockFile, val)
           mockFile.previewElement.classList.add('dz-success')
           mockFile.previewElement.classList.add('dz-complete')
         }

+ 3 - 2
src/components/Upload/SingleImage.vue

@@ -72,8 +72,9 @@
         this.$emit('input', val)
       },
       handleImageSuccess(response) {
-        this.emitInput(process.env.VUE_APP_BASE_API + '/api/files/view-file?path=' + response.url)
-        this.$emit("success", process.env.VUE_APP_BASE_API + '/api/files/view-file?path=' + response.url)
+        // this.emitInput(process.env.VUE_APP_BASE_API + '/api/files/view-file?path=' + response.url)
+        this.emitInput(response.url)
+        this.$emit("success", response.url)
       }
     }
   }

+ 1 - 1
src/views/food/components/FoodDetail.vue

@@ -155,7 +155,7 @@ export default {
       let imgs = this.postForm.images
       let imgIndex = -1
       for (let i = 0; i < imgs.length; i++) {
-        if (imgs[i] === file.fileUrl) {
+        if (imgs[i] === file.url) {
           imgIndex = i
           break
         }

+ 1 - 1
src/views/foodModifier/components/ModifierDetail.vue

@@ -92,7 +92,7 @@ export default {
       let imgs = this.postForm.images
       let imgIndex = -1
       for (let i = 0; i < imgs.length; i++) {
-        if (imgs[i] === file.fileUrl) {
+        if (imgs[i] === file.url) {
           imgIndex = i
           break
         }

+ 9 - 3
src/views/user/index.vue

@@ -48,7 +48,7 @@
       </el-table-column>
       <el-table-column label="性别" align="center" width="60">
         <template slot-scope="{row}">
-          <span>{{ row.gender | genderFilter}}</span>
+          <span>{{ row.gender | genderFilter }}</span>
         </template>
       </el-table-column>
       <el-table-column label="最后登录时间" align="center" width="180">
@@ -62,7 +62,7 @@
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="280">
-        <template slot-scope="{row,$index}">
+        <template slot-scope="{row}">
           <el-button type="primary" size="mini" @click="handleUpdate(row)">
             更新
           </el-button>
@@ -79,7 +79,13 @@
       </el-table-column>
     </el-table>
 
-    <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="fetchData" />
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="listQuery.pageNum"
+      :limit.sync="listQuery.pageSize"
+      @pagination="fetchData"
+    />
 
     <el-dialog :title="textMapping[dialogStatus]" :visible.sync="dialogFormVisible">
       <el-form ref="dataForm" :rules="rules" :model="params" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;">