From b39e0358272ba224a7659fa2ed262c00e790ff0b Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 09 三月 2026 14:26:04 +0800
Subject: [PATCH] 图片地址修正
---
src/pages/equipmentManagement/upkeep/detail.vue | 11 ++++++-----
src/pages/inspectionUpload/index.vue | 13 +++++++------
src/pages/equipmentManagement/upkeep/maintain.vue | 10 +++++-----
3 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/src/pages/equipmentManagement/upkeep/detail.vue b/src/pages/equipmentManagement/upkeep/detail.vue
index aaf70d0..1578097 100644
--- a/src/pages/equipmentManagement/upkeep/detail.vue
+++ b/src/pages/equipmentManagement/upkeep/detail.vue
@@ -196,11 +196,11 @@
if (url.startsWith("http://") || url.startsWith("https://")) {
return url;
}
- const uploadsIndex = url.indexOf("uploads");
- if (uploadsIndex !== -1) {
- const relativePath = url.substring(uploadsIndex);
- return `${config.fileUrl}/${relativePath}`;
- }
+ // const uploadsIndex = url.indexOf("uploads");
+ // if (uploadsIndex !== -1) {
+ // const relativePath = url.substring(uploadsIndex);
+ // return `${config.fileUrl}/${relativePath}`;
+ // }
return `${config.fileUrl}/${url}`;
};
@@ -260,6 +260,7 @@
// 澶勭悊闄勪欢鏁版嵁 - 鏀寔澶氱鏁版嵁缁撴瀯
console.log(data.imagesFile);
fileList.value = data.imagesFile;
+ console.log(formatFileUrl(fileList.value[0].url));
};
// 杩斿洖涓婁竴椤�
diff --git a/src/pages/equipmentManagement/upkeep/maintain.vue b/src/pages/equipmentManagement/upkeep/maintain.vue
index f99dcc1..d3b8549 100644
--- a/src/pages/equipmentManagement/upkeep/maintain.vue
+++ b/src/pages/equipmentManagement/upkeep/maintain.vue
@@ -926,11 +926,11 @@
if (url.startsWith("http://") || url.startsWith("https://")) {
return url;
}
- const uploadsIndex = url.indexOf("uploads");
- if (uploadsIndex !== -1) {
- const relativePath = url.substring(uploadsIndex);
- return `${config.fileUrl}/${relativePath}`;
- }
+ // const uploadsIndex = url.indexOf("uploads");
+ // if (uploadsIndex !== -1) {
+ // const relativePath = url.substring(uploadsIndex);
+ // return `${config.fileUrl}/${relativePath}`;
+ // }
return `${config.fileUrl}/${url}`;
};
diff --git a/src/pages/inspectionUpload/index.vue b/src/pages/inspectionUpload/index.vue
index 7ac9f3d..c0293dd 100644
--- a/src/pages/inspectionUpload/index.vue
+++ b/src/pages/inspectionUpload/index.vue
@@ -281,6 +281,7 @@
class="attachment-item"
@click="previewAttachment(file)">
<view class="attachment-preview-container">
+ <!-- {{formatFileUrl(file.url || file.downloadUrl)}} -->
<image v-if="file.type === 'image' || isImageFile(file)"
:src="formatFileUrl(file.url || file.downloadUrl)"
class="attachment-preview"
@@ -1053,7 +1054,7 @@
};
// 鏂囦欢璁块棶鍩虹鍩燂紙鍚庣瑕佹眰鍓嶇紑锛�
- const filePreviewBase = config.baseUrl;
+ const filePreviewBase = config.fileUrl;
// 灏嗗悗绔繑鍥炵殑鏂囦欢鍦板潃瑙勮寖鎴愬彲璁块棶URL
// 鍏煎鍦烘櫙锛�
@@ -1595,11 +1596,11 @@
if (url.startsWith("http://") || url.startsWith("https://")) {
return url;
}
- const uploadsIndex = url.indexOf("uploads");
- if (uploadsIndex !== -1) {
- const relativePath = url.substring(uploadsIndex);
- return `${config.fileUrl}/${relativePath}`;
- }
+ // const uploadsIndex = url.indexOf("uploads");
+ // if (uploadsIndex !== -1) {
+ // const relativePath = url.substring(uploadsIndex);
+ // return `${config.fileUrl}/${relativePath}`;
+ // }
return `${config.fileUrl}/${url}`;
};
// 鏍煎紡鍖栨枃浠跺ぇ灏�
--
Gitblit v1.9.3