From 72a73a1cde9ebbfc0097609595fe2226ae84b9f0 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期四, 30 十月 2025 14:27:16 +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