图片上传接口返回8008url

This commit is contained in:
liaoboping 2024-07-16 10:42:12 +08:00
parent c15d6c4468
commit 671f8de49d
6 changed files with 3 additions and 12 deletions

View File

@ -7,7 +7,6 @@ ENV = 'development'
# 若依管理系统/开发环境 # 若依管理系统/开发环境
VUE_APP_BASE_API = '/prod-api' VUE_APP_BASE_API = '/prod-api'
VUE_APP_API_TARGET_URL = 'http://47.121.27.78:8080/' VUE_APP_API_TARGET_URL = 'http://47.121.27.78:8080/'
VUE_APP_IMAGE_PREVIEW_API = '/imagePreview/upload'
# 应用访问路径 例如使用前缀 /admin/ # 应用访问路径 例如使用前缀 /admin/
VUE_APP_CONTEXT_PATH = '/' VUE_APP_CONTEXT_PATH = '/'

View File

@ -176,7 +176,7 @@ export default {
// //
let length = quill.getSelection().index; let length = quill.getSelection().index;
// res.url // res.url
quill.insertEmbed(length, "image", this.$imagePreviewApi + '/' + res.data.url.split('/').pop()); quill.insertEmbed(length, "image", res.data.url);
// //
quill.setSelection(length + 1); quill.setSelection(length + 1);
} else { } else {

View File

@ -80,7 +80,7 @@ export default {
fileList () { fileList () {
return (this.value ? this.value.split(',') : []).map(url => { return (this.value ? this.value.split(',') : []).map(url => {
return { return {
url: process.env.VUE_APP_IMAGE_PREVIEW_API + '/' + url.split('/').pop(), url: url,
name: url, name: url,
}; };
}); });

View File

@ -45,7 +45,6 @@ import VueMeta from 'vue-meta'
import DictData from '@/components/DictData' import DictData from '@/components/DictData'
// 全局属性挂载 // 全局属性挂载
Vue.prototype.$imagePreviewApi = process.env.VUE_APP_IMAGE_PREVIEW_API
// 全局方法挂载 // 全局方法挂载
Vue.prototype.getDicts = getDicts Vue.prototype.getDicts = getDicts

View File

@ -92,7 +92,7 @@
<el-table-column label="主键id" align="center" prop="id" v-if="false"/> <el-table-column label="主键id" align="center" prop="id" v-if="false"/>
<el-table-column label="封面" align="center" prop="cover"> <el-table-column label="封面" align="center" prop="cover">
<template slot-scope="{ row }"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="标题名称" align="center" prop="captionName" /> <el-table-column label="标题名称" align="center" prop="captionName" />

View File

@ -41,13 +41,6 @@ module.exports = {
// ['^' + process.env.VUE_APP_BASE_API]: '' // ['^' + process.env.VUE_APP_BASE_API]: ''
// } // }
}, },
'/imagePreview': {
target: 'http://47.121.27.78:8008',
changeOrigin: true,
pathRewrite: {
'^/imagePreview': '',
},
},
}, },
disableHostCheck: true disableHostCheck: true
}, },