From 95a50290100ccf858a9113203c2672d5704b0dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Sun, 17 Sep 2023 19:16:38 +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 | 52 +++++++++++----------- src/config/index.js | 6 ++- src/pages/page1/components/InsertImage.vue | 4 +- src/pages/page1/index.js | 5 ++- 4 files changed, 36 insertions(+), 31 deletions(-) diff --git a/public/index.html b/public/index.html index 43788e3..906c71f 100644 --- a/public/index.html +++ b/public/index.html @@ -1,34 +1,36 @@ - - - - - <%= htmlWebpackPlugin.options.title %> - - - - - <% if (process.env.NODE_ENV === 'development' ) { %> - - <% } %> - <% if (process.env.NODE_ENV === 'production' ) { %> - - <% } %> + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + <% 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 e3bc9a2..739ab6b 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -6,12 +6,14 @@ const interfaceUrl = window._CONFIG.interfaceUrl + '/laws-sinotruk/' //本地 // const interfaceUrl = 'https://srms.foton.com.cn/api/' //线上 -const uploadFilePath = '/laws-sinotruk/onlyoffice/upload' +const uploadFilePath = '/laws-sinotruk/onlyoffice/upload' // 上传文件地址 +const downloadFilePath = window._CONFIG.downloadUrl + '/laws-sinotruk/onlyoffice/downLoadFile' // 下载文件地址 const staticFilePath = window._CONFIG.interfaceUrl + '/laws-sinotruk/onlyoffice/downLoadFile' //本地 // const staticFilePath = 'https://srms.foton.com.cn/api/att/attFile/downloadFile' //线上 module.exports = { interfaceUrl, uploadFilePath, - staticFilePath + staticFilePath, + downloadFilePath } diff --git a/src/pages/page1/components/InsertImage.vue b/src/pages/page1/components/InsertImage.vue index caf6bcc..f210299 100644 --- a/src/pages/page1/components/InsertImage.vue +++ b/src/pages/page1/components/InsertImage.vue @@ -567,9 +567,9 @@ export default { }).then(res => { this.loading = false console.log(res) - this.imageUrl = this.staticFilePath + '?path=' + res.result.url + this.imageUrl = this.downloadFilePath + '?path=' + res.result.url const img = new Image() - img.src = this.staticFilePath + '?path=' + res.result.url + img.src = this.downloadFilePath + '?path=' + res.result.url if (img.complete) { this.imgOrigin = { width: img.width, diff --git a/src/pages/page1/index.js b/src/pages/page1/index.js index bcc8d16..9069bb8 100644 --- a/src/pages/page1/index.js +++ b/src/pages/page1/index.js @@ -1,7 +1,7 @@ import Vue from 'vue' import App from './App.vue' -import { interfaceUrl, uploadFilePath, staticFilePath } from '@/config' +import { interfaceUrl, uploadFilePath, staticFilePath, downloadFilePath } from '@/config' // eslint-disable-next-line import/extensions import '@/core/use.js' import axios from '../../plugins/axios2' @@ -9,11 +9,12 @@ import store from '@/store' Vue.prototype.interfaceUrl = interfaceUrl Vue.prototype.uploadFilePath = uploadFilePath +Vue.prototype.downloadFilePath = downloadFilePath Vue.prototype.staticFilePath = staticFilePath Vue.prototype.$axios = axios Vue.config.productionTip = false new Vue({ store, - render: (h) => h(App), + render: (h) => h(App) }).$mount('#app')