图片上传接口返回8008url
This commit is contained in:
parent
c15d6c4468
commit
671f8de49d
|
@ -7,7 +7,6 @@ ENV = 'development'
|
|||
# 若依管理系统/开发环境
|
||||
VUE_APP_BASE_API = '/prod-api'
|
||||
VUE_APP_API_TARGET_URL = 'http://47.121.27.78:8080/'
|
||||
VUE_APP_IMAGE_PREVIEW_API = '/imagePreview/upload'
|
||||
|
||||
# 应用访问路径 例如使用前缀 /admin/
|
||||
VUE_APP_CONTEXT_PATH = '/'
|
||||
|
|
|
@ -176,7 +176,7 @@ export default {
|
|||
// 获取光标所在位置
|
||||
let length = quill.getSelection().index;
|
||||
// 插入图片 res.url为服务器返回的图片地址
|
||||
quill.insertEmbed(length, "image", this.$imagePreviewApi + '/' + res.data.url.split('/').pop());
|
||||
quill.insertEmbed(length, "image", res.data.url);
|
||||
// 调整光标到最后
|
||||
quill.setSelection(length + 1);
|
||||
} else {
|
||||
|
|
|
@ -80,7 +80,7 @@ export default {
|
|||
fileList () {
|
||||
return (this.value ? this.value.split(',') : []).map(url => {
|
||||
return {
|
||||
url: process.env.VUE_APP_IMAGE_PREVIEW_API + '/' + url.split('/').pop(),
|
||||
url: url,
|
||||
name: url,
|
||||
};
|
||||
});
|
||||
|
|
|
@ -45,7 +45,6 @@ import VueMeta from 'vue-meta'
|
|||
import DictData from '@/components/DictData'
|
||||
|
||||
// 全局属性挂载
|
||||
Vue.prototype.$imagePreviewApi = process.env.VUE_APP_IMAGE_PREVIEW_API
|
||||
|
||||
// 全局方法挂载
|
||||
Vue.prototype.getDicts = getDicts
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
<el-table-column label="主键id" align="center" prop="id" v-if="false"/>
|
||||
<el-table-column label="封面" align="center" prop="cover">
|
||||
<template slot-scope="{ row }">
|
||||
<img :src="$imagePreviewApi + '/' + row.cover.split('/').pop()" alt="" style="width:50px;height:50px;object-fit:cover;">
|
||||
<img :src="row.cover" alt="" style="width:50px;height:50px;object-fit:cover;">
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="标题名称" align="center" prop="captionName" />
|
||||
|
|
|
@ -41,13 +41,6 @@ module.exports = {
|
|||
// ['^' + process.env.VUE_APP_BASE_API]: ''
|
||||
// }
|
||||
},
|
||||
'/imagePreview': {
|
||||
target: 'http://47.121.27.78:8008',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/imagePreview': '',
|
||||
},
|
||||
},
|
||||
},
|
||||
disableHostCheck: true
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user