| | |
| | | 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" |
| | |
| | | const uploadsIndex = url.indexOf("uploads"); |
| | | if (uploadsIndex !== -1) { |
| | | const relativePath = url.substring(uploadsIndex); |
| | | return `${config.baseUrl}/${relativePath}`; |
| | | return `${config.fileUrl}/${relativePath}`; |
| | | } |
| | | return `${config.baseUrl}/${url}`; |
| | | return `${config.fileUrl}/${url}`; |
| | | }; |
| | | // 格式化文件大小 |
| | | const formatFileSize = size => { |