From 50e199c43c4ceb028ffbaf3d7bba60319c27f81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Sun, 17 Sep 2023 18:46:49 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=8F=92=E5=85=A5=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 4 +- src/config/index.js | 6 +- src/pages/page1/components/InsertImage.vue | 1089 ++++++++++---------- src/plugins/axios2.js | 4 +- vue.config.js | 21 +- 5 files changed, 558 insertions(+), 566 deletions(-) diff --git a/public/index.html b/public/index.html index 5e82218..43788e3 100644 --- a/public/index.html +++ b/public/index.html @@ -13,14 +13,14 @@ <% if (process.env.NODE_ENV === 'development' ) { %> <% } %> <% if (process.env.NODE_ENV === 'production' ) { %> <% } %> diff --git a/src/config/index.js b/src/config/index.js index 9030ff2..e3bc9a2 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -3,12 +3,12 @@ * @author: chenxiaoxi * @date: 2021-08-18 17:47:46 */ -const interfaceUrl = window._CONFIG.interfaceUrl + '/api/' //本地 +const interfaceUrl = window._CONFIG.interfaceUrl + '/laws-sinotruk/' //本地 // const interfaceUrl = 'https://srms.foton.com.cn/api/' //线上 -const uploadFilePath = 'api/att/attFile/uploadNew' +const uploadFilePath = '/laws-sinotruk/onlyoffice/upload' -const staticFilePath = window._CONFIG.interfaceUrl + '/api/att/attFile/downloadFileForSarNew' //本地 +const staticFilePath = window._CONFIG.interfaceUrl + '/laws-sinotruk/onlyoffice/downLoadFile' //本地 // const staticFilePath = 'https://srms.foton.com.cn/api/att/attFile/downloadFile' //线上 module.exports = { interfaceUrl, diff --git a/src/pages/page1/components/InsertImage.vue b/src/pages/page1/components/InsertImage.vue index c840aaf..caf6bcc 100644 --- a/src/pages/page1/components/InsertImage.vue +++ b/src/pages/page1/components/InsertImage.vue @@ -18,12 +18,12 @@ v-bind="formItemLayout" @submit="handleSubmit" > - - - - - - + + + + + + - +
- +
Upload
@@ -57,7 +57,7 @@ - + @@ -65,587 +65,588 @@ diff --git a/src/plugins/axios2.js b/src/plugins/axios2.js index 16e6424..480acdf 100644 --- a/src/plugins/axios2.js +++ b/src/plugins/axios2.js @@ -8,7 +8,7 @@ import axios from 'axios' const config = { // baseURL: '/' - baseURL: window._CONFIG.interfaceUrl,//本地 + baseURL: window._CONFIG.interfaceUrl//本地 // baseURL: 'https://srms.foton.com.cn',//线上 // timeout: 60 * 1000, // Timeout // withCredentials: true, // Check cross-site Access-Control @@ -23,7 +23,6 @@ _axios.interceptors.request.use( (error) => // Do something with request error Promise.reject(error) - ) // Add a response interceptor @@ -34,7 +33,6 @@ _axios.interceptors.response.use( (error) => // Do something with response error Promise.reject(error) - ) export default _axios diff --git a/vue.config.js b/vue.config.js index 174bfd5..eaeacab 100644 --- a/vue.config.js +++ b/vue.config.js @@ -7,8 +7,9 @@ const pageMethod = require('./utils/getPages.js') const pages = pageMethod.pages() const configs = pageMethod.configs() + // const { interfaceUrl } = require('./src/config') -function resolve(dir) { +function resolve (dir) { return path.join(__dirname, dir) } @@ -40,22 +41,14 @@ module.exports = { port: 8081, headers: { 'Access-Control-Allow-Origin': '*' }, proxy: { - '/api': { - target: 'localhost:8080/', + '/laws-sinotruk': { + target: 'http://139.9.235.66:8184', + ws: false, changeOrigin: true, pathRewrite: { - '^/api': '' + // '/laws-sinotruk': '' // 默认所有请求都加了jero-boot前缀,需要去掉 } - }, - // '/api': { - // // target: 'https://qcwss.cloud.tencent.com/domain/ajax', - // target: interfaceUrl, - // ws: true, - // changeOrigin: true, - // pathRewrite: { - // '^/api': '', // rewrite path - // }, - // } + } } } }