From 00ae6e7c8ccb3e8abad027104529f18f68142a48 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 31 十二月 2025 10:41:56 +0800
Subject: [PATCH] 陕西昭德型煤: 1.现场巡检上传附件查看附件修改联调
---
src/components/imageUpload/index.vue | 24 ++++++++----------------
1 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/src/components/imageUpload/index.vue b/src/components/imageUpload/index.vue
index 51e4331..aa0afc5 100644
--- a/src/components/imageUpload/index.vue
+++ b/src/components/imageUpload/index.vue
@@ -99,11 +99,12 @@
<script setup>
import { ref, computed, watch, onMounted, onUnmounted, nextTick } from 'vue';
import { getToken } from "@/utils/auth";
+import config from '@/config.js';
// Props 瀹氫箟
const props = defineProps({
modelValue: [String, Object, Array],
- action: { type: String, default: "/common/minioUploads" },
+ action: { type: String, default: "/common/commonUploads" },
data: { type: Object },
limit: { type: Number, default: 5 },
fileSize: { type: Number, default: 10 }, // 榛樿10MB锛岄�傚悎瑙嗛
@@ -114,7 +115,7 @@
isShowTip: { type: Boolean, default: true },
disabled: { type: Boolean, default: false },
drag: { type: Boolean, default: false }, // 鎷嶇収涓嶉渶瑕佹嫋鎷�
- statusType: { type: Number, default: "" }, // 鐢ㄤ簬鍖哄垎涓嶅悓鐘舵�佺殑涓婁紶
+ type: { type: Number, default: "" }, // 鐢ㄤ簬鍖哄垎涓嶅悓鐘舵�佺殑涓婁紶
maxVideoDuration: { type: Number, default: 30 }, // 鏈�澶ц棰戞椂闀匡紙绉掞級
});
@@ -130,19 +131,10 @@
// 璁$畻灞炴��
const uploadFileUrl = computed(() => {
- // 鑾峰彇鍩虹API鍦板潃锛岄�傞厤uniapp鐜
- let baseUrl = '';
-
- // 灏濊瘯澶氱鏂瑰紡鑾峰彇baseUrl
- if (process.env.VUE_APP_BASE_API) {
- baseUrl = process.env.VUE_APP_BASE_API;
- } else if (process.env.NODE_ENV === 'development') {
- baseUrl = 'http://192.168.1.147:9036';
- } else {
- baseUrl = 'http://192.168.1.147:9036';
- }
-
+ // 鑾峰彇鍩虹API鍦板潃锛屼紭鍏堜娇鐢� config.js 涓殑 baseUrl
+ const baseUrl = config.baseUrl || process.env.VUE_APP_BASE_API || 'http://192.168.1.147:7016';
const fullUrl = baseUrl + props.action;
+ console.log('涓婁紶URL:', fullUrl);
return fullUrl;
});
const headers = computed(() => {
@@ -182,7 +174,7 @@
const testServerConnection = () => {
return new Promise((resolve) => {
uni.request({
- url: uploadFileUrl.value.replace('/common/minioUploads', '/common/test'),
+ url: uploadFileUrl.value.replace('/common/commonUploads', '/common/commonUploads'),
method: 'GET',
timeout: 5000,
success: (res) => {
@@ -372,7 +364,7 @@
filePath: filePath,
name: 'files',
formData: {
- type: props.statusType || 0,
+ type: props.type || 0,
...(props.data || {})
},
header: {
--
Gitblit v1.9.3