Browse Source

fix: hardcoded baseurl - ref to #264

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>
pull/292/head
Wing-Kam Wong 3 years ago
parent
commit
96a2d90439
  1. 2
      packages/nc-gui/components/project/graphqlClient.vue
  2. 2
      packages/nc-gui/components/project/spreadsheet/apis/gqlApi.js
  3. 2
      packages/nc-gui/components/project/swaggerClient.vue
  4. 2
      packages/nc-gui/components/project/xcInfo.vue
  5. 4
      packages/nc-gui/layouts/default.vue

2
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]) if (this.$store.state.graphqlClient.list && this.$store.state.graphqlClient.list[0])
this.webViewUrl = this.url = this.$store.state.graphqlClient.list[0].url; this.webViewUrl = this.url = this.$store.state.graphqlClient.list[0].url;
try { 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: { headers: {
'xc-auth': this.$store.state.users.token 'xc-auth': this.$store.state.users.token
} }

2
packages/nc-gui/components/project/spreadsheet/apis/gqlApi.js

@ -29,7 +29,7 @@ export default class GqlApi {
post(url, params) { post(url, params) {
return this.$axios({ return this.$axios({
url, url: `${this.$axios.defaults.baseURL}/${url}`,
method: 'post', method: 'post',
data: params, data: params,
}) })

2
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]) // if (this.$store.state.graphqlClient.list && this.$store.state.graphqlClient.list[0])
// this.webViewUrl = this.url = this.$store.state.graphqlClient.list[0].url; // this.webViewUrl = this.url = this.$store.state.graphqlClient.list[0].url;
try { 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: { headers: {
'xc-auth': this.$store.state.users.token 'xc-auth': this.$store.state.users.token
} }

2
packages/nc-gui/components/project/xcInfo.vue

@ -252,7 +252,7 @@ export default {
}, methods: { }, methods: {
async loadProjectApiInfo() { async loadProjectApiInfo() {
try { 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: { headers: {
'xc-auth': this.$store.state.users.token 'xc-auth': this.$store.state.users.token
} }

4
packages/nc-gui/layouts/default.vue

@ -624,7 +624,7 @@
</v-list-item-title> </v-list-item-title>
</v-list-item>--> </v-list-item>-->
<v-list-item v-if="swaggerOrGraphiqlUrl" dense @click.stop="openUrl(swaggerOrGraphiqlUrl)"> <v-list-item v-if="swaggerOrGraphiqlUrl" dense @click.stop="openUrl(`${$axios.defaults.baseURL}${swaggerOrGraphiqlUrl}`)">
<v-list-item-title> <v-list-item-title>
<v-icon small key="terminal-dash"> <v-icon small key="terminal-dash">
@ -977,7 +977,7 @@ export default {
async loadProjectInfo() { async loadProjectInfo() {
if (this.$route.params.project_id) if (this.$route.params.project_id)
try { 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: { headers: {
'xc-auth': this.$store.state.users.token 'xc-auth': this.$store.state.users.token
} }

Loading…
Cancel
Save