refactor: refs #7358 use location.hostname
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
This commit is contained in:
parent
611e65a353
commit
ef3a2c0ee9
|
@ -18,18 +18,15 @@ const state = useState();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const appName = 'Lilium';
|
const appName = 'Lilium';
|
||||||
const pinnedModulesRef = ref();
|
const pinnedModulesRef = ref();
|
||||||
const env = process.env.NODE_ENV;
|
const hostname = window.location.hostname;
|
||||||
|
const env = ref();
|
||||||
|
|
||||||
const getEnvironment = computed(() => {
|
const getEnvironment = computed(() => {
|
||||||
switch (env) {
|
env.value = hostname.split('-');
|
||||||
case 'development':
|
if (env.value.length <= 1) return;
|
||||||
return 'DEV';
|
return env.value[0];
|
||||||
case 'production':
|
|
||||||
return null;
|
|
||||||
default:
|
|
||||||
return env;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => stateStore.setMounted());
|
onMounted(() => stateStore.setMounted());
|
||||||
const refresh = () => window.location.reload();
|
const refresh = () => window.location.reload();
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue