From 96a2d904393b94c6940d79ff3071f861ef2bca01 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Thu, 17 Jun 2021 23:30:55 +0800 Subject: [PATCH] fix: hardcoded baseurl - ref to #264 Signed-off-by: Wing-Kam Wong --- packages/nc-gui/components/project/graphqlClient.vue | 2 +- packages/nc-gui/components/project/spreadsheet/apis/gqlApi.js | 2 +- packages/nc-gui/components/project/swaggerClient.vue | 2 +- packages/nc-gui/components/project/xcInfo.vue | 2 +- packages/nc-gui/layouts/default.vue | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui/components/project/graphqlClient.vue b/packages/nc-gui/components/project/graphqlClient.vue index eb18f09109..4838845398 100644 --- a/packages/nc-gui/components/project/graphqlClient.vue +++ b/packages/nc-gui/components/project/graphqlClient.vue @@ -55,7 +55,7 @@ export default { if (this.$store.state.graphqlClient.list && this.$store.state.graphqlClient.list[0]) this.webViewUrl = this.url = this.$store.state.graphqlClient.list[0].url; try { - const {info} = (await this.$axios.get(`/nc/${this.$route.params.project_id}/projectApiInfo`, { + const {info} = (await this.$axios.get(`${this.$axios.defaults.baseURL}/nc/${this.$route.params.project_id}/projectApiInfo`, { headers: { 'xc-auth': this.$store.state.users.token } diff --git a/packages/nc-gui/components/project/spreadsheet/apis/gqlApi.js b/packages/nc-gui/components/project/spreadsheet/apis/gqlApi.js index 926c99c1b3..2b3ae838c8 100644 --- a/packages/nc-gui/components/project/spreadsheet/apis/gqlApi.js +++ b/packages/nc-gui/components/project/spreadsheet/apis/gqlApi.js @@ -29,7 +29,7 @@ export default class GqlApi { post(url, params) { return this.$axios({ - url, + url: `${this.$axios.defaults.baseURL}/${url}`, method: 'post', data: params, }) diff --git a/packages/nc-gui/components/project/swaggerClient.vue b/packages/nc-gui/components/project/swaggerClient.vue index d59d3bddc0..883908a800 100644 --- a/packages/nc-gui/components/project/swaggerClient.vue +++ b/packages/nc-gui/components/project/swaggerClient.vue @@ -55,7 +55,7 @@ export default { // if (this.$store.state.graphqlClient.list && this.$store.state.graphqlClient.list[0]) // this.webViewUrl = this.url = this.$store.state.graphqlClient.list[0].url; try { - const {info} = (await this.$axios.get(`/nc/${this.$route.params.project_id}/projectApiInfo`, { + const {info} = (await this.$axios.get(`${this.$axios.defaults.baseURL}/nc/${this.$route.params.project_id}/projectApiInfo`, { headers: { 'xc-auth': this.$store.state.users.token } diff --git a/packages/nc-gui/components/project/xcInfo.vue b/packages/nc-gui/components/project/xcInfo.vue index 5ba70af562..13f21bfd1c 100644 --- a/packages/nc-gui/components/project/xcInfo.vue +++ b/packages/nc-gui/components/project/xcInfo.vue @@ -252,7 +252,7 @@ export default { }, methods: { async loadProjectApiInfo() { try { - const {info, aggregatedInfo} = (await this.$axios.get(`/nc/${this.$route.params.project_id}/projectApiInfo`, { + const {info, aggregatedInfo} = (await this.$axios.get(`${this.$axios.defaults.baseURL}/nc/${this.$route.params.project_id}/projectApiInfo`, { headers: { 'xc-auth': this.$store.state.users.token } diff --git a/packages/nc-gui/layouts/default.vue b/packages/nc-gui/layouts/default.vue index 1b76d27f5a..5907f95af1 100644 --- a/packages/nc-gui/layouts/default.vue +++ b/packages/nc-gui/layouts/default.vue @@ -624,7 +624,7 @@ --> - + @@ -977,7 +977,7 @@ export default { async loadProjectInfo() { if (this.$route.params.project_id) try { - const {info} = (await this.$axios.get(`/nc/${this.$route.params.project_id}/projectApiInfo`, { + const {info} = (await this.$axios.get(`${this.$axios.defaults.baseURL}/nc/${this.$route.params.project_id}/projectApiInfo`, { headers: { 'xc-auth': this.$store.state.users.token }