Skip to content

Commit 2644bf1

Browse files
committed
update: fix URL encoding for image sources in ComparisonResults component
1 parent e4a9010 commit 2644bf1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/components/sections/ComparisonResults.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,15 @@ const garmentSrcs = computed(() => {
188188
189189
type MethodItem = { stem: string; displayName: string; strategy: string; src: string }
190190
191+
// 文件名中若有 % 需编码为 %25,否则 URL 会解析错误
192+
const encodeStemForPath = (stem: string) => stem.replace(/%/g, '%25')
193+
191194
const methodItems = computed<MethodItem[]>(() =>
192195
filteredMethodStems.value.map(stem => ({
193196
stem,
194197
displayName: methodDict[stem].displayName,
195198
strategy: methodDict[stem].strategy,
196-
src: `${baseUrl}results/${currentEntry.value.id}/inpainting-result/${stem}.png`,
199+
src: `${baseUrl}results/${currentEntry.value.id}/inpainting-result/${encodeStemForPath(stem)}.png`,
197200
}))
198201
)
199202

0 commit comments

Comments
 (0)