diff --git a/src/components/common/popBox/topToolMoreOptions.vue b/src/components/common/popBox/topToolMoreOptions.vue index 6677ef62..1ea43dd2 100644 --- a/src/components/common/popBox/topToolMoreOptions.vue +++ b/src/components/common/popBox/topToolMoreOptions.vue @@ -82,7 +82,7 @@ export default { }, data () { return { - importBox: { show: false, title: this.$t('overall.import'), type: 1,width:'600px' }, + importBox: { show: false, title: this.$t('overall.import'), type: 1, width: '600px' }, importFile: null, importFileList: [], importResult: null, @@ -145,12 +145,12 @@ export default { }, exportAll () { const params = JSON.parse(JSON.stringify(this.params)) - if (this.params2){ - Object.keys(this.params2).forEach(key=>{ - if ( params[key] ) { - if ( params[key].prototype.toString.call(val) === '[object Object]' ){ - Object.assign(params[key],this.params2[key]) - } else if (params[key].prototype.toString.call(val) === '[object Array]'){ + if (this.params2) { + Object.keys(this.params2).forEach(key => { + if (params[key]) { + if (params[key].prototype.toString.call(val) === '[object Object]') { + Object.assign(params[key], this.params2[key]) + } else if (params[key].prototype.toString.call(val) === '[object Array]') { params[key].concat(this.params2[key]) } } else { diff --git a/src/components/setting/GalaxyProxyDebug.vue b/src/components/setting/GalaxyProxyDebug.vue new file mode 100644 index 00000000..75d45b23 --- /dev/null +++ b/src/components/setting/GalaxyProxyDebug.vue @@ -0,0 +1,525 @@ + + + + + + + + + + + + + + + + {{$t('galaxyProxy.debug.send')}} + + + + + {{$t('galaxyProxy.debug.requestParams')}} + + + + + + + + + + + + + + + + + + + + + + + {{$t('galaxyProxy.debug.request.header')}} + + {{$t('galaxyProxy.debug.response.header')}} + {{$t('galaxyProxy.debug.response.body')}} + + + + + + + + + + + + diff --git a/src/components/table/settings/GalaxyProxyTable.vue b/src/components/table/settings/GalaxyProxyTable.vue index 29922a56..e97cf838 100644 --- a/src/components/table/settings/GalaxyProxyTable.vue +++ b/src/components/table/settings/GalaxyProxyTable.vue @@ -99,6 +99,7 @@ {{$t('overall.duplicate')}} {{$t('overall.delete')}} + {{$t('overall.debug')}} diff --git a/src/mixins/dataList.js b/src/mixins/dataList.js index 1a424a64..d225c3f8 100644 --- a/src/mixins/dataList.js +++ b/src/mixins/dataList.js @@ -179,7 +179,7 @@ export default { let localStorageTableTitle = localStorage.getItem('cn-tableTitle-' + localStorage.getItem('cn-username') + '-' + this.tableId) localStorageTableTitle = localStorageTableTitle ? JSON.parse(localStorageTableTitle) : this.$refs.dataTable.tableTitle this.tools.customTableTitle = this.$refs.dataTable.tableTitle.map((item, index) => { // 修复切换中英文的问题 - if(localStorageTableTitle[index]){ + if (localStorageTableTitle[index]) { item.show = localStorageTableTitle[index].show } return item diff --git a/src/utils/api.js b/src/utils/api.js index ad400155..b5826dcb 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -118,7 +118,7 @@ export async function getI18n () { export async function getIso36112JsonData (suffix) { const request = new Promise(resolve => { axios({ - url: `${window.location.protocol}//${window.location.host}:${window.location.port}/geojson/${suffix}.json`, + url: `${window.location.protocol}//${window.location.host}:${window.location.port}/geojson/${suffix}.json` }).then(response => { resolve(response.data || response || null) }) diff --git a/src/utils/http.js b/src/utils/http.js index 7adc7a3c..44bfccd0 100644 --- a/src/utils/http.js +++ b/src/utils/http.js @@ -55,6 +55,36 @@ axios.interceptors.response.use( return Promise.reject(error) } ) +export function getForDebug (url, params) { + return new Promise((resolve) => { + axios.get(url, { + params: params + }).then(response => { + resolve(response) + }).catch(err => { + if (err.response) { + resolve(err.response) + } else if (err.message) { + resolve(err.message) + } + }) + }) +} + +export function postForDebug (url, params, headers) { + return new Promise(resolve => { + axios.post(url, params, { headers: headers }).then(response => { + resolve(response, response) + }).catch(err => { + if (err.response) { + resolve(err.response) + } else if (err.message) { + resolve(err.message) + } + }) + }) +} + export function get (url, params) { return new Promise((resolve) => { axios.get(url, { diff --git a/src/views/settings/GalaxyProxy.vue b/src/views/settings/GalaxyProxy.vue index 3e830bbd..924c56d7 100644 --- a/src/views/settings/GalaxyProxy.vue +++ b/src/views/settings/GalaxyProxy.vue @@ -18,6 +18,10 @@ type="button" @click="add"> + + + @@ -62,6 +67,11 @@ +