魏熙美 hace 6 años
padre
commit
9e5d73d1ed

+ 8
- 1
VUECODE/smart-property-manage/config/index.js Ver fichero

@@ -9,7 +9,14 @@ module.exports = {
9 9
     // Paths
10 10
     assetsSubDirectory: 'static',
11 11
     assetsPublicPath: '/',
12
-    proxyTable: {},
12
+    proxyTable: {
13
+      // '/api': {
14
+      //   target: 'http://baidu.com',
15
+      //   pathRewrite: {
16
+      //     '^/api': ''
17
+      //   }
18
+      // }
19
+    },
13 20
 
14 21
     // Various Dev Server settings
15 22
     host: 'localhost', // can be overwritten by process.env.HOST

+ 3
- 2
VUECODE/smart-property-manage/src/components/XUploader/index.vue Ver fichero

@@ -2,13 +2,14 @@
2 2
   <el-upload
3 3
     :class="{ 'avatar-uploader': !multi }"
4 4
     :action="apiURL"
5
-    :show-file-list="multi"
5
+    :show-file-list="multi == true"
6 6
     :list-type="multi ? 'picture-card' : undefined"
7 7
     :file-list="imgList"
8 8
     :before-upload="beforeImgUpload"
9 9
     :headers="headers"
10 10
     :on-success="handleSuccess"
11 11
     :on-remove="handleRemove"
12
+    name="uploadFiles"
12 13
     >
13 14
     <template v-if="multi">
14 15
       <i class="el-icon-plus"></i>
@@ -34,7 +35,7 @@ export default {
34 35
   },
35 36
   computed: {
36 37
     apiURL () {
37
-      return '/property-api/uploadimage'
38
+      return process.env.BASE_API + '/uploadimage'
38 39
     },
39 40
     imgList () {
40 41
       if (!this.value) return undefined

+ 13
- 12
VUECODE/smart-property-manage/src/views/social/announcement/add.vue Ver fichero

@@ -7,18 +7,19 @@
7 7
       <el-form-item label="公告轮播图" prop="announcementCarouselImg" >
8 8
         <span style="color: darkgray;">轮播图为横幅位展示图片,不会显示在公告详情页</span>
9 9
         <div>
10
-          <div style="width: 500px;">
11
-            <el-upload
12
-              :show-file-list="false"
13
-              :on-success="handleAvatarSuccess"
14
-              :before-upload="beforeAvatarUpload"
15
-              :action="uploadImgUrl"
16
-              class="avatar-uploader"
17
-              name="uploadFiles">
18
-              <img v-if="imageUrl" :src="imageUrl" class="avatar">
19
-              <i v-else class="el-icon-plus avatar-uploader-icon"/>
20
-            </el-upload>
21
-          </div>
10
+          <x-uploader v-model="ruleForm.announcementCarouselImg"></x-uploader>
11
+          <!--<div style="width: 500px;">-->
12
+            <!--<el-upload-->
13
+              <!--:show-file-list="false"-->
14
+              <!--:on-success="handleAvatarSuccess"-->
15
+              <!--:before-upload="beforeAvatarUpload"-->
16
+              <!--:action="uploadImgUrl"-->
17
+              <!--class="avatar-uploader"-->
18
+              <!--name="uploadFiles">-->
19
+              <!--<img v-if="imageUrl" :src="imageUrl" class="avatar">-->
20
+              <!--<i v-else class="el-icon-plus avatar-uploader-icon"/>-->
21
+            <!--</el-upload>-->
22
+          <!--</div>-->
22 23
         </div>
23 24
       </el-form-item>
24 25
       <el-form-item label="公告内容" prop="announcementContent">