From fc66a89e5b60adb94f880308c4fa908997a5f04d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E4=BC=9F=E4=BD=B3?= <2797716443@qq.com> Date: Wed, 16 Jun 2021 13:44:27 +0800 Subject: [PATCH] commit --- src/common/axios/index.js | 13 +++++-------- .../domesticStandardsAndRegulations/index.vue | 3 +-- vue.config.js | 7 ------- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/common/axios/index.js b/src/common/axios/index.js index 47a084bf8..bd1faa601 100644 --- a/src/common/axios/index.js +++ b/src/common/axios/index.js @@ -89,8 +89,7 @@ export default { if (_this) { _this[loading] = true } - const prefix = config.prefix || '/api/' - _axios.post(prefix + '/' + url + '?' + new Date().getTime(), _formData).then(res => { + _axios.post(api() + url + '?' + new Date().getTime(), _formData).then(res => { if (_this && loading) { _this[loading] = false } if (res.data.ok !== undefined && showTips) { let type = res.data.ok ? 'success' : 'warning' @@ -132,8 +131,7 @@ export default { if (_this) { _this[loading] = true } - const prefix = config.prefix || '/api/' - _axios.post(prefix + '/' + url + '?' + new Date().getTime(), param).then(res => { + _axios.post(api() + url + '?' + new Date().getTime(), param).then(res => { if (_this && loading) { _this[loading] = false } if (res.data.ok !== undefined && showTips) { let type = res.data.ok ? 'success' : 'warning' @@ -172,8 +170,7 @@ export default { if (_this) { _this[loading] = true } - const prefix = config.prefix || '/api/' - _axios.post(prefix + '/' + url + '?' + new Date().getTime(), _formData).then(res => { + _axios.post(api() + url + '?' + new Date().getTime(), _formData).then(res => { if (_this && loading) { _this[loading] = false } thenFun.call(this, res.data) }).catch(err => { @@ -205,8 +202,8 @@ export default { if (_this) { _this[loading] = true } - const prefix = config.prefix || '/api/' - _axios.get(prefix + '/' + url + '?_t=' + new Date().getTime(), { params: param, cancelToken: config.cancelToken }).then(res => { + + _axios.get(api() + url + '?_t=' + new Date().getTime(), { params: param, cancelToken: config.cancelToken }).then(res => { if (_this && loading) { _this[loading] = false } // 返回data对象 if (res.ok !== undefined) { diff --git a/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue b/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue index 644b79a8e..bda33b3c6 100644 --- a/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue +++ b/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue @@ -1878,8 +1878,7 @@ export default { this.sarMenu.parentIds = this.selectSarMenu.id } this.$http.post('lawss/sarMenu/addSarMenu', this.sarMenu, { - _this: this, - prefix: '/foton' + _this: this }, res => { this.selectMenu() // 新增成功后,更新二级菜单 this.menuModalFlag = false diff --git a/vue.config.js b/vue.config.js index 762e30e77..40b40d896 100644 --- a/vue.config.js +++ b/vue.config.js @@ -91,13 +91,6 @@ module.exports = { pathRewrite: { '^/onlyOffice': '/api' } - }, - '/foton': { - target: 'http://39.98.140.126:10005', - changeOrigin: true, - pathRewrite: { - '^/foton': '/api' - } } } }