From 8c4480f281db3100a055d5b23c629aa41846fa1e Mon Sep 17 00:00:00 2001 From: Andy Han Date: Wed, 27 Dec 2023 17:38:27 +0800 Subject: [PATCH] Fix Wrong badgeUrl repo badge tab when rootPath is not empty (#3033) Fix #3032 --- web/src/components/repo/settings/BadgeTab.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/components/repo/settings/BadgeTab.vue b/web/src/components/repo/settings/BadgeTab.vue index 74d56f08b..991ebef09 100644 --- a/web/src/components/repo/settings/BadgeTab.vue +++ b/web/src/components/repo/settings/BadgeTab.vue @@ -84,9 +84,10 @@ async function loadBranches() { const baseUrl = `${window.location.protocol}//${window.location.hostname}${ window.location.port ? `:${window.location.port}` : '' -}${useConfig().rootPath}`; +}`; +const { rootPath } = useConfig(); const badgeUrl = computed( - () => `/api/badges/${repo.value.id}/status.svg${branch.value !== '' ? `?branch=${branch.value}` : ''}`, + () => `${rootPath}/api/badges/${repo.value.id}/status.svg${branch.value !== '' ? `?branch=${branch.value}` : ''}`, ); const repoUrl = computed( () => `/repos/${repo.value.id}${branch.value !== '' ? `/branches/${encodeURIComponent(branch.value)}` : ''}`,