| | |
| | | class="file-item" |
| | | @click="previewFile(file)"> |
| | | <image v-if="file.type.includes('image')" |
| | | :src="file.url" |
| | | :src="formatFileUrl(file.url)" |
| | | class="file-preview" |
| | | mode="aspectFill" /> |
| | | <view v-else |
| | |
| | | const uploadsIndex = url.indexOf("uploads"); |
| | | if (uploadsIndex !== -1) { |
| | | const relativePath = url.substring(uploadsIndex); |
| | | return `${config.baseUrl}/profile/${relativePath}`; |
| | | return `${config.fileUrl}/${relativePath}`; |
| | | } |
| | | return `${config.baseUrl}/profile/${url}`; |
| | | return `${config.fileUrl}/${url}`; |
| | | }; |
| | | |
| | | // 判断是否为图片文件 |