Skip to content

Commit 5fd9fef

Browse files
committed
feat(ui): replace request base url
1 parent 290c401 commit 5fd9fef

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

cmdb-ui/src/modules/cmdb/views/ci_types/index.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
accept=".json"
6060
:showUploadList="false"
6161
style="display: inline-block"
62-
action="/api/v0.1/ci_types/template/import/file"
62+
:action="ciTypesUploadUrl"
6363
@change="changeUploadFile"
6464
>
6565
<ops-icon type="veops-import"/>
@@ -497,7 +497,8 @@ export default {
497497
modelExportVisible: false,
498498
pageLoading: false,
499499
500-
preferenceData: {}
500+
preferenceData: {},
501+
ciTypesUploadUrl: `${process.env.VUE_APP_API_BASE_URL || '/api'}/v0.1/ci_types/template/import/file`,
501502
}
502503
},
503504
computed: {

cmdb-ui/src/modules/cmdb/views/discovery/index.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ export default {
256256
download() {
257257
const x = new XMLHttpRequest()
258258
const that = this
259-
x.open('GET', `/api/v0.1/adr/template/export/file`, true)
259+
const base_url = process.env.VUE_APP_API_BASE_URL || '/api'
260+
x.open('GET', `${base_url}/v0.1/adr/template/export/file`, true)
260261
x.responseType = 'blob'
261262
x.onload = function(e) {
262263
const url = window.URL.createObjectURL(x.response)
@@ -272,7 +273,8 @@ export default {
272273
formData.append('file', file)
273274
const that = this
274275
var xhr = new XMLHttpRequest()
275-
xhr.open('POST', `/api/v0.1/adr/template/import/file`)
276+
const base_url = process.env.VUE_APP_API_BASE_URL || '/api'
277+
xhr.open('POST', `${base_url}/v0.1/adr/template/import/file`)
276278
xhr.onreadystatechange = function() {
277279
const state = Number(xhr.readyState)
278280
if (state === 4) {

0 commit comments

Comments
 (0)