From 71beff1699701e18c2503791c7ba1437c89966aa Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期三, 30 九月 2026 15:26:43 +0800
Subject: [PATCH] feat(wxcp): 活动封面改用附件中间表,并修正附件地址同源
---
src/views/wxcp/activity/modules/signup-list.vue | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/views/wxcp/activity/modules/signup-list.vue b/src/views/wxcp/activity/modules/signup-list.vue
index 2c1b953..fabaec0 100644
--- a/src/views/wxcp/activity/modules/signup-list.vue
+++ b/src/views/wxcp/activity/modules/signup-list.vue
@@ -16,6 +16,7 @@
} from 'ant-design-vue';
import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
+import { toAccessibleFileUrl } from '#/utils';
import {
cancelSignup,
checkInSignup,
@@ -59,6 +60,16 @@
function isImage(item: WxCpActivityApi.SignupAttachment) {
return (item.contentType || '').startsWith('image/');
+}
+
+/** 鍚庣闄勪欢鍦板潃甯︾殑鏄悗绔嚜宸遍厤缃殑鍩熷悕锛屾敼鍐欐垚鍚屾簮璺緞鍚庢墠鑳借 <img> 鍔犺浇 */
+function fileUrl(item: WxCpActivityApi.SignupAttachment) {
+ return toAccessibleFileUrl(item.previewURL || item.url);
+}
+
+/** 涓嬭浇閾炬帴鍚岀悊锛屼紭鍏堢敤 downloadURL */
+function downloadUrl(item: WxCpActivityApi.SignupAttachment) {
+ return toAccessibleFileUrl(item.downloadURL || item.url);
}
function formatSize(bytes?: number) {
@@ -215,18 +226,18 @@
</div>
<a
v-if="isImage(item)"
- :href="item.previewURL || item.url"
+ :href="fileUrl(item)"
target="_blank"
rel="noopener noreferrer"
>
<img
- :src="item.previewURL || item.url"
+ :src="fileUrl(item)"
alt="闄勪欢棰勮"
class="max-h-40 rounded object-contain"
/>
</a>
<a
- :href="item.downloadURL || item.url"
+ :href="downloadUrl(item)"
target="_blank"
rel="noopener noreferrer"
class="text-xs text-blue-500 hover:underline"
--
Gitblit v1.9.3