zammad/app/frontend/shared/composables/useBaseUrl.ts
2026-01-02 15:41:09 +02:00

21 lines
505 B
TypeScript

// Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
import { computed } from 'vue'
import { useApplicationStore } from '#shared/stores/application.ts'
export const useBaseUrl = () => {
const application = useApplicationStore()
const baseUrl = computed(() => {
const { http_type: httpType, fqdn } = application.config
if (!fqdn || fqdn === 'zammad.example.com') return window.location.origin
return `${httpType}://${fqdn}`
})
return {
baseUrl,
}
}