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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user