Derive API origin from VITE_API_BASE_URL for hotlink image src.

Nest api config (baseUrl + baseUrlRoot) so dev cross-origin /i requests work without a separate app-env flag.
This commit is contained in:
2026-10-27 14:03:30 +01:00
parent dfc52749b2
commit 6407b64f26
3 changed files with 13 additions and 3 deletions
+6 -1
View File
@@ -7,6 +7,7 @@
<script setup lang="ts">
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import { config } from '@/config';
import { buildHotlinkImagePath } from '@/utils/share/buildHotlinkImagePath';
const route = useRoute();
@@ -19,6 +20,10 @@ const imageSrc = computed((): string | null => {
return null;
}
return buildHotlinkImagePath(uploadId, secret);
const { baseUrlRoot } = config.api;
const path = buildHotlinkImagePath(uploadId, secret);
return `${baseUrlRoot}${path}`;
});
</script>