fix 插入图片
This commit is contained in:
+27
-25
@@ -1,34 +1,36 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="">
|
<html lang="">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||||
<script type="text/javascript" src="/v1/plugins.js"></script>
|
<script type="text/javascript" src="/v1/plugins.js"></script>
|
||||||
<script type="text/javascript" src="/v1/plugins-ui.js"></script>
|
<script type="text/javascript" src="/v1/plugins-ui.js"></script>
|
||||||
<link rel="stylesheet" href="/v1/plugins.css">
|
<link rel="stylesheet" href="/v1/plugins.css">
|
||||||
<!-- 全局配置 -->
|
<!-- 全局配置 -->
|
||||||
<% if (process.env.NODE_ENV === 'development' ) { %>
|
<% if (process.env.NODE_ENV === 'development' ) { %>
|
||||||
<script>
|
<script>
|
||||||
window._CONFIG = {
|
window._CONFIG = {
|
||||||
'interfaceUrl': 'http://139.9.235.66:8184',
|
'interfaceUrl': 'http://139.9.235.66:8184',
|
||||||
};
|
'downloadUrl': 'http://139.9.235.66:8184'
|
||||||
</script>
|
}
|
||||||
<% } %>
|
</script>
|
||||||
<% if (process.env.NODE_ENV === 'production' ) { %>
|
<% } %>
|
||||||
<script>
|
<% if (process.env.NODE_ENV === 'production' ) { %>
|
||||||
window._CONFIG = {
|
<script>
|
||||||
'interfaceUrl': 'http://laws-sinotruk-server-kmc2c.yf-grp:8080',
|
window._CONFIG = {
|
||||||
};
|
'interfaceUrl': 'http://laws.sinotruk.com',
|
||||||
</script>
|
'downloadUrl': 'http://laws-sinotruk-server-kmc2c.yf-grp:8080'
|
||||||
<% } %>
|
}
|
||||||
|
</script>
|
||||||
|
<% } %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>
|
<noscript>
|
||||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
|
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
|
||||||
Please enable it to continue.</strong>
|
Please enable it to continue.</strong>
|
||||||
</noscript>
|
</noscript>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<!-- built files will be auto injected -->
|
<!-- built files will be auto injected -->
|
||||||
|
|||||||
+4
-2
@@ -6,12 +6,14 @@
|
|||||||
const interfaceUrl = window._CONFIG.interfaceUrl + '/laws-sinotruk/' //本地
|
const interfaceUrl = window._CONFIG.interfaceUrl + '/laws-sinotruk/' //本地
|
||||||
// const interfaceUrl = 'https://srms.foton.com.cn/api/' //线上
|
// 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 = window._CONFIG.interfaceUrl + '/laws-sinotruk/onlyoffice/downLoadFile' //本地
|
||||||
// const staticFilePath = 'https://srms.foton.com.cn/api/att/attFile/downloadFile' //线上
|
// const staticFilePath = 'https://srms.foton.com.cn/api/att/attFile/downloadFile' //线上
|
||||||
module.exports = {
|
module.exports = {
|
||||||
interfaceUrl,
|
interfaceUrl,
|
||||||
uploadFilePath,
|
uploadFilePath,
|
||||||
staticFilePath
|
staticFilePath,
|
||||||
|
downloadFilePath
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -567,9 +567,9 @@ export default {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(res)
|
console.log(res)
|
||||||
this.imageUrl = this.staticFilePath + '?path=' + res.result.url
|
this.imageUrl = this.downloadFilePath + '?path=' + res.result.url
|
||||||
const img = new Image()
|
const img = new Image()
|
||||||
img.src = this.staticFilePath + '?path=' + res.result.url
|
img.src = this.downloadFilePath + '?path=' + res.result.url
|
||||||
if (img.complete) {
|
if (img.complete) {
|
||||||
this.imgOrigin = {
|
this.imgOrigin = {
|
||||||
width: img.width,
|
width: img.width,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
|
||||||
import App from './App.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
|
// eslint-disable-next-line import/extensions
|
||||||
import '@/core/use.js'
|
import '@/core/use.js'
|
||||||
import axios from '../../plugins/axios2'
|
import axios from '../../plugins/axios2'
|
||||||
@@ -9,11 +9,12 @@ import store from '@/store'
|
|||||||
|
|
||||||
Vue.prototype.interfaceUrl = interfaceUrl
|
Vue.prototype.interfaceUrl = interfaceUrl
|
||||||
Vue.prototype.uploadFilePath = uploadFilePath
|
Vue.prototype.uploadFilePath = uploadFilePath
|
||||||
|
Vue.prototype.downloadFilePath = downloadFilePath
|
||||||
Vue.prototype.staticFilePath = staticFilePath
|
Vue.prototype.staticFilePath = staticFilePath
|
||||||
Vue.prototype.$axios = axios
|
Vue.prototype.$axios = axios
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
store,
|
store,
|
||||||
render: (h) => h(App),
|
render: (h) => h(App)
|
||||||
}).$mount('#app')
|
}).$mount('#app')
|
||||||
|
|||||||
Reference in New Issue
Block a user