Browse Source

文件上传配置

gcz 1 year ago
parent
commit
cbb8ec7957

+ 1 - 1
.env.development

@@ -11,4 +11,4 @@ VUE_APP_BASE_API = '/tourismadmin-api'
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
 
 # 开发环境文件上传
-VUE_APP_UPLOAD_FILE_API = 'https://fileupload.hw.hongweisoft.com'
+VUE_APP_UPLOAD_FILE_API = '/tourismadmin-api'

+ 3 - 0
.env.production

@@ -6,3 +6,6 @@ ENV = 'production'
 
 # 景区营销管理系统/生产环境
 VUE_APP_BASE_API = '/tourismadmin-api'
+
+# 正式环境文件上传
+VUE_APP_UPLOAD_FILE_API = '/tourismadmin-api'

+ 1 - 1
.env.staging

@@ -10,4 +10,4 @@ ENV = 'staging'
 VUE_APP_BASE_API = '/tourismadmin-api'
 
 # 开发环境文件上传
-VUE_APP_UPLOAD_FILE_API = 'https://fileupload.hw.hongweisoft.com'
+VUE_APP_UPLOAD_FILE_API = '/tourismadmin-api'

+ 2 - 1
src/components/Editor/index.vue

@@ -10,6 +10,7 @@
       :headers="headers"
       style="display: none"
       ref="upload"
+      :data="{bucket:'tourism'}"
       v-if="this.type == 'url'"
     >
     </el-upload>
@@ -60,7 +61,7 @@ export default {
   },
   data() {
     return {
-      uploadUrl: process.env.VUE_APP_UPLOAD_FILE_API + "/upload/single/minio", // 上传的图片服务器地址
+      uploadUrl: process.env.VUE_APP_UPLOAD_FILE_API + "/thirdapi/upload/single/minio", // 上传的图片服务器地址
       headers: {
         Authorization: "Bearer " + getToken()
       },

+ 2 - 1
src/components/FileUpload/index.vue

@@ -11,6 +11,7 @@
       :on-success="handleUploadSuccess"
       :show-file-list="false"
       :headers="headers"
+      :data="{bucket:'tourism'}"
       class="upload-file-uploader"
       ref="fileUpload"
     >
@@ -73,7 +74,7 @@ export default {
       number: 0,
       uploadList: [],
       baseUrl: process.env.VUE_APP_BASE_API,
-      uploadFileUrl: process.env.VUE_APP_UPLOAD_FILE_API + "/upload/single/minio", // 上传文件服务器地址
+      uploadFileUrl: process.env.VUE_APP_UPLOAD_FILE_API + "/thirdapi/upload/single/minio", // 上传文件服务器地址
       headers: {
         Authorization: "Bearer " + getToken(),
       },

+ 2 - 1
src/components/ImageUpload/index.vue

@@ -15,6 +15,7 @@
       :headers="headers"
       :file-list="fileList"
       :on-preview="handlePictureCardPreview"
+      :data="{bucket:'tourism'}"
       :class="{hide: this.fileList.length >= this.limit}"
     >
       <i class="el-icon-plus"></i>
@@ -77,7 +78,7 @@ export default {
       dialogVisible: false,
       hideUpload: false,
       baseUrl: process.env.VUE_APP_BASE_API,
-      uploadImgUrl: process.env.VUE_APP_UPLOAD_FILE_API + "/upload/single/minio", // 上传的图片服务器地址
+      uploadImgUrl: process.env.VUE_APP_UPLOAD_FILE_API + "/thirdapi/upload/single/minio", // 上传的图片服务器地址
       headers: {
         Authorization: "Bearer " + getToken(),
       },

+ 3 - 2
src/views/information/informationMr/dialog/addAndEdit.vue

@@ -3,7 +3,7 @@
  * @Author: Sugar.
  * @Date: 2023-11-24 13:55:00
  * @LastEditors: gcz
- * @LastEditTime: 2024-03-20 14:47:26
+ * @LastEditTime: 2024-03-25 16:21:13
  * @FilePath: \tourism_admin_ui\src\views\information\informationMr\dialog\addAndEdit.vue
  * @Copyright: Copyright (c) 2016~2023 by Sugar., All Rights Reserved.
 -->
@@ -56,6 +56,7 @@
             :headers="uploadObj.headers"
             :show-file-list="false"
             accept=".jpg,.png"
+            :data="{bucket:'tourism'}"
             :on-success="handleAvatarSuccess"
             :before-upload="beforeAvatarUpload"
           >
@@ -144,7 +145,7 @@ export default {
         ],
       },
       uploadObj: {
-        url: process.env.VUE_APP_UPLOAD_FILE_API + "/upload/single/minio",
+        url: process.env.VUE_APP_UPLOAD_FILE_API + "/thirdapi/upload/single/minio",
         Headers: { Authorization: "Bearer " + getToken() },
       },
       validTtime:[],