refactor: refs #7358 use location.hostname
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jon Elias 2025-03-25 15:10:57 +01:00
parent 611e65a353
commit ef3a2c0ee9
1 changed files with 6 additions and 9 deletions

View File

@ -18,18 +18,15 @@ const state = useState();
const user = state.getUser();
const appName = 'Lilium';
const pinnedModulesRef = ref();
const env = process.env.NODE_ENV;
const hostname = window.location.hostname;
const env = ref();
const getEnvironment = computed(() => {
switch (env) {
case 'development':
return 'DEV';
case 'production':
return null;
default:
return env;
}
env.value = hostname.split('-');
if (env.value.length <= 1) return;
return env.value[0];
});
onMounted(() => stateStore.setMounted());
const refresh = () => window.location.reload();
</script>