From 7ae4e27a487e282b60dc65d7836d1bcd86e7a464 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期一, 27 十月 2025 16:51:43 +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