diff --git a/src/App.vue b/src/App.vue index e463a7903..8382c3b1b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,6 @@ @@ -157,6 +159,7 @@ import auth from './auth' import message from './message' import router from './router' + import {HTTP} from './http-common' import NamespaceService from './services/namespace' import authTypes from './models/authTypes' @@ -174,6 +177,21 @@ currentDate: new Date(), userMenuActive: false, authTypes: authTypes, + config: null, + } + }, + beforeCreate() { + HTTP.get('info') + .then(r => { + this.config = r.data + // eslint-disable-next-line + console.log(this.config) + }) + + }, + computed: { + appReady () { + return !!this.config } }, beforeMount() { diff --git a/src/components/sharing/linkSharing.vue b/src/components/sharing/linkSharing.vue index b4de89d96..4e76291d2 100644 --- a/src/components/sharing/linkSharing.vue +++ b/src/components/sharing/linkSharing.vue @@ -188,7 +188,7 @@ copy(text) }, getShareLink(hash) { - return this.$config.frontend_url + 'share/' + hash + '/auth' + return this.$root.config.frontend_url + 'share/' + hash + '/auth' }, }, } diff --git a/src/main.js b/src/main.js index dd62a5d2f..b3f4a12d6 100644 --- a/src/main.js +++ b/src/main.js @@ -20,12 +20,6 @@ Vue.config.productionTip = false import Notifications from 'vue-notification' Vue.use(Notifications) -import config from './config' -config.initConfig() - .then(() => { - Vue.prototype.$config = config.getConfig() - }) - // Icons import { library } from '@fortawesome/fontawesome-svg-core' import { faSignOutAlt } from '@fortawesome/free-solid-svg-icons'