周立森 5 anos atrás
pai
commit
8df582049f

+ 4
- 2
foyo-service/src/main/java/com/huiju/foyo/service/impl/ImageServiceimpl.java Ver arquivo

18
  */
18
  */
19
 @Service("ImageService")
19
 @Service("ImageService")
20
 public class ImageServiceimpl implements ImageServiceI {
20
 public class ImageServiceimpl implements ImageServiceI {
21
+    @Value("${assets.images}")
22
+    String imagePath;
21
     
23
     
22
     @Override
24
     @Override
23
     public String getImageUrl(MultipartFile uploadFile) throws IOException {
25
     public String getImageUrl(MultipartFile uploadFile) throws IOException {
24
         //保存的文件名
26
         //保存的文件名
25
         String imgName = System.currentTimeMillis() + ".png";
27
         String imgName = System.currentTimeMillis() + ".png";
26
         //保存路径
28
         //保存路径
27
-        String path = "D:\\test\\images\\" + imgName;
28
-        String rebackPath = "images\\" + imgName;
29
+        String path = imagePath + imgName;
30
+        String rebackPath = "uploadimage/" + imgName;
29
         //生成保存文件
31
         //生成保存文件
30
         File troUploadFile = new File(path);
32
         File troUploadFile = new File(path);
31
         //将上传文件保存到路径
33
         //将上传文件保存到路径

+ 3
- 0
foyo-service/src/main/resources/application.yml Ver arquivo

12
   configuration:
12
   configuration:
13
     log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
13
     log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
14
   mapper-locations: classpath:mapper/*.xml
14
   mapper-locations: classpath:mapper/*.xml
15
+
16
+assets:
17
+  images: /opt/www/upload/images/

+ 1
- 1
vue-element-admin/config/index.js Ver arquivo

60
      * then assetsPublicPath should be set to "/bar/".
60
      * then assetsPublicPath should be set to "/bar/".
61
      * In most cases please use '/' !!!
61
      * In most cases please use '/' !!!
62
      */
62
      */
63
-    assetsPublicPath: '/',
63
+    assetsPublicPath: './',
64
 
64
 
65
     /**
65
     /**
66
      * Source Maps
66
      * Source Maps

+ 1
- 1
vue-element-admin/config/prod.env.js Ver arquivo

1
 module.exports = {
1
 module.exports = {
2
   NODE_ENV: '"production"',
2
   NODE_ENV: '"production"',
3
   ENV_CONFIG: '"prod"',
3
   ENV_CONFIG: '"prod"',
4
-  BASE_API: '"https://api-prod"'
4
+  BASE_API: '"/api/admin/"'
5
 }
5
 }

+ 2
- 1
vue-element-admin/src/views/carousel/edit.vue Ver arquivo

12
           :action= "uploadImgUrl"
12
           :action= "uploadImgUrl"
13
           :show-file-list="false"
13
           :show-file-list="false"
14
           :on-success="handleAvatarSuccess"
14
           :on-success="handleAvatarSuccess"
15
+          :with-credentials="true"
15
           class="avatar-uploader"
16
           class="avatar-uploader"
16
           name="uploadFiles">
17
           name="uploadFiles">
17
           <img v-if="imageUrl" :src="imageUrl" class="avatar">
18
           <img v-if="imageUrl" :src="imageUrl" class="avatar">
83
         sort: '',
84
         sort: '',
84
         imageUrl: ''
85
         imageUrl: ''
85
       },
86
       },
86
-      uploadImgUrl: process.env.BASE_API + '/uploadimage',
87
+      uploadImgUrl: process.env.BASE_API + 'uploadimage',
87
       dialogStatus: '',
88
       dialogStatus: '',
88
       downloadLoading: false,
89
       downloadLoading: false,
89
       formLabelWidth: '120px',
90
       formLabelWidth: '120px',

+ 1
- 1
vue-element-admin/src/views/case/CoverMovement.vue Ver arquivo

78
         labelList: [],
78
         labelList: [],
79
         type: 'movement'
79
         type: 'movement'
80
       },
80
       },
81
-      uploadImgUrl: process.env.BASE_API + '/uploadimage',
81
+      uploadImgUrl: process.env.BASE_API + 'uploadimage',
82
       dialogStatus: '',
82
       dialogStatus: '',
83
       downloadLoading: false,
83
       downloadLoading: false,
84
       formLabelWidth: '120px',
84
       formLabelWidth: '120px',

+ 1
- 1
vue-element-admin/src/views/case/add.vue Ver arquivo

131
         content: '',
131
         content: '',
132
         type: 'case'
132
         type: 'case'
133
       },
133
       },
134
-      uploadImgUrl: process.env.BASE_API + '/uploadimage',
134
+      uploadImgUrl: process.env.BASE_API + 'uploadimage',
135
       dialogStatus: '',
135
       dialogStatus: '',
136
       downloadLoading: false,
136
       downloadLoading: false,
137
       formLabelWidth: '120px',
137
       formLabelWidth: '120px',

+ 2
- 1
vue-element-admin/src/views/case/cover.vue Ver arquivo

6
           :action= "uploadImgUrl"
6
           :action= "uploadImgUrl"
7
           :show-file-list="false"
7
           :show-file-list="false"
8
           :on-success="handleAvatarSuccess"
8
           :on-success="handleAvatarSuccess"
9
+          :with-credentials="true"
9
           class="avatar-uploader"
10
           class="avatar-uploader"
10
           name="uploadFiles">
11
           name="uploadFiles">
11
           <img v-if="imageUrl" :src="imageUrl" class="avatar">
12
           <img v-if="imageUrl" :src="imageUrl" class="avatar">
78
         labelList: [],
79
         labelList: [],
79
         type: 'case'
80
         type: 'case'
80
       },
81
       },
81
-      uploadImgUrl: process.env.BASE_API + '/uploadimage',
82
+      uploadImgUrl: process.env.BASE_API + 'uploadimage',
82
       dialogStatus: '',
83
       dialogStatus: '',
83
       downloadLoading: false,
84
       downloadLoading: false,
84
       formLabelWidth: '120px',
85
       formLabelWidth: '120px',

+ 1
- 1
vue-element-admin/src/views/case/edit.vue Ver arquivo

131
         content: '',
131
         content: '',
132
         type: 'case'
132
         type: 'case'
133
       },
133
       },
134
-      uploadImgUrl: process.env.BASE_API + '/uploadimage',
134
+      uploadImgUrl: process.env.BASE_API + 'uploadimage',
135
       dialogStatus: '',
135
       dialogStatus: '',
136
       downloadLoading: false,
136
       downloadLoading: false,
137
       formLabelWidth: '120px',
137
       formLabelWidth: '120px',

+ 1
- 1
vue-element-admin/src/views/case/servicecase/add.vue Ver arquivo

101
         serviceImageUrl: '',
101
         serviceImageUrl: '',
102
         labelList: []
102
         labelList: []
103
       },
103
       },
104
-      uploadImgUrl: process.env.BASE_API + '/uploadimage',
104
+      uploadImgUrl: process.env.BASE_API + 'uploadimage',
105
       dialogStatus: '',
105
       dialogStatus: '',
106
       downloadLoading: false,
106
       downloadLoading: false,
107
       formLabelWidth: '120px',
107
       formLabelWidth: '120px',

+ 1
- 1
vue-element-admin/src/views/company/edit.vue Ver arquivo

75
         sort: '',
75
         sort: '',
76
         companyImg: ''
76
         companyImg: ''
77
       },
77
       },
78
-      uploadImgUrl: process.env.BASE_API + '/uploadimage',
78
+      uploadImgUrl: process.env.BASE_API + 'uploadimage',
79
       dialogStatus: '',
79
       dialogStatus: '',
80
       downloadLoading: false,
80
       downloadLoading: false,
81
       formLabelWidth: '120px',
81
       formLabelWidth: '120px',

+ 1
- 1
vue-element-admin/src/views/partner/add.vue Ver arquivo

83
         sort: '',
83
         sort: '',
84
         logoImg: ''
84
         logoImg: ''
85
       },
85
       },
86
-      uploadImgUrl: process.env.BASE_API + '/uploadimage',
86
+      uploadImgUrl: process.env.BASE_API + 'uploadimage',
87
       dialogStatus: '',
87
       dialogStatus: '',
88
       downloadLoading: false,
88
       downloadLoading: false,
89
       formLabelWidth: '120px',
89
       formLabelWidth: '120px',

+ 1
- 1
vue-element-admin/src/views/service/edit.vue Ver arquivo

103
         serviceImageUrl: '',
103
         serviceImageUrl: '',
104
         labelList: []
104
         labelList: []
105
       },
105
       },
106
-      uploadImgUrl: process.env.BASE_API + '/uploadimage',
106
+      uploadImgUrl: process.env.BASE_API + 'uploadimage',
107
       dialogStatus: '',
107
       dialogStatus: '',
108
       downloadLoading: false,
108
       downloadLoading: false,
109
       formLabelWidth: '120px',
109
       formLabelWidth: '120px',