From 6a20878b9b1e3460531b055d72d5d671f761abc3 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期四, 16 十月 2025 15:36:20 +0800
Subject: [PATCH] 定制商品

---
 pages/product/m-buy/goods.vue |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/pages/product/m-buy/goods.vue b/pages/product/m-buy/goods.vue
index 6af3cf0..128c85c 100644
--- a/pages/product/m-buy/goods.vue
+++ b/pages/product/m-buy/goods.vue
@@ -250,6 +250,7 @@
 			cosClient: null, // COS瀹㈡埛绔�
 			bucket: '', // 瀛樺偍妗�
 			region: '', // 鍦板煙
+			endpoint: '', // COS璁块棶endpoint
 			previewUrls: {} // 鏂囦欢棰勮鍦板潃缂撳瓨
 		};
 	},
@@ -390,6 +391,7 @@
 				});
 				this.bucket = res.data.data.bucket;
 				this.region = res.data.data.region;
+				this.endpoint = res.data.data.endpoint; // 鑾峰彇endpoint
 			}).catch(err => {
 				console.error('鍒濆鍖朇OS澶辫触', err);
 				// 浣跨敤setTimeout寤惰繜鏄剧ず鎻愮ず锛岄伩鍏嶅奖鍝嶅脊绐�
@@ -958,6 +960,13 @@
 			if (this.previewUrls && this.previewUrls[fileKey]) {
 				return this.previewUrls[fileKey];
 			}
+			// 濡傛灉娌℃湁http鍓嶇紑锛岄渶瑕佹嫾鎺ndpoint杩涜鏄剧ず
+			if (fileKey && !fileKey.startsWith('http://') && !fileKey.startsWith('https://')) {
+				// 浣跨敤endpoint鎷兼帴瀹屾暣鐨刄RL
+				if (this.endpoint) {
+					return this.endpoint + '/' + fileKey;
+				}
+			}
 			// 鍚﹀垯杩斿洖鍘熷鍊�
 			return fileKey;
 		},

--
Gitblit v1.8.0