|
@@ -50,11 +50,12 @@ export default {
|
|
|
seteditor () {
|
|
|
this.editor = new E(this.$refs.toolbar, this.$refs.editor)
|
|
|
this.editor.customConfig.uploadImgShowBase64 = true // base 64 存储图片
|
|
|
- this.editor.customConfig.uploadImgServer = ''// 配置服务器端地址
|
|
|
+ // eslint-disable-next-line no-template-curly-in-string
|
|
|
+ this.editor.customConfig.uploadImgServer = `${this.$http.BASE_URL}/oss/file/webUpload/upload`// 配置服务器端地址
|
|
|
this.editor.customConfig.uploadImgHeaders = { }// 自定义 header
|
|
|
- this.editor.customConfig.uploadFileName = '' // 后端接受上传文件的参数名
|
|
|
+ this.editor.customConfig.uploadFileName = 'file' // 后端接受上传文件的参数名
|
|
|
this.editor.customConfig.uploadImgMaxSize = 2 * 1024 * 1024 // 将图片大小限制为 2M
|
|
|
- this.editor.customConfig.uploadImgMaxLength = 6 // 限制一次最多上传 3 张图片
|
|
|
+ this.editor.customConfig.uploadImgMaxLength = 1 // 限制一次最多上传 3 张图片
|
|
|
this.editor.customConfig.uploadImgTimeout = 3 * 60 * 1000 // 设置超时时间
|
|
|
this.editor.customConfig.menus = [
|
|
|
'head', // 标题
|
|
@@ -84,6 +85,8 @@ export default {
|
|
|
},
|
|
|
success: (xhr, editor, result) => {
|
|
|
// 图片上传成功回调
|
|
|
+ // editor.txt.append('<img style="max-width: 650px" src=' + result.lsUrl + '></img>')
|
|
|
+ editor.uploadImg.insertLinkImg(result.lsUrl)
|
|
|
},
|
|
|
timeout: (xhr, editor) => {
|
|
|
// 网络超时的回调
|