diff --git a/src/api/common.js b/src/api/common.js index 87c582b..e061fff 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -15,11 +15,11 @@ } // 图片上传 -export function Uploadimg(fileobj) { +export function UploadFile(fileobj) { const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'file/upload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/api/common.js b/src/api/common.js index 87c582b..e061fff 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -15,11 +15,11 @@ } // 图片上传 -export function Uploadimg(fileobj) { +export function UploadFile(fileobj) { const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'file/upload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/components/wangeditor/wangeditor.vue b/src/components/wangeditor/wangeditor.vue index 9961069..d89a499 100644 --- a/src/components/wangeditor/wangeditor.vue +++ b/src/components/wangeditor/wangeditor.vue @@ -33,7 +33,6 @@ 'underline', // 下划线 'strikeThrough', // 删除线 'foreColor', // 文字颜色 - 'backColor', // 背景颜色 'list', // 列表 'justify', // 对齐方式 'quote', // 引用 @@ -45,12 +44,12 @@ data() { return { editorContent: '', - editor: '' + editor: null } }, watch: { content(val) { - if(val!==this.getContent()){ + if (val !== this.getContent()) { this.setContent(val) } } @@ -62,7 +61,8 @@ initEditor() { var that = this that.editor = new E(that.$refs.editorElem) // 创建富文本实例 - that.editor.customConfig.debug = location.href.indexOf('wangeditor_debug_mode=1') > 0 + that.editor.customConfig.debug = true + debugger that.editor.customConfig.onchange = html => { that.editorContent = html console.log('onchange') @@ -143,10 +143,10 @@ that.editor.create() that.setContent(that.content) }, - getContent: function() { + getContent() { return this.editor.txt.html() }, - setContent: function(content) { + setContent(content) { this.editor.txt.html(content) }, changeContent(content) { diff --git a/src/api/common.js b/src/api/common.js index 87c582b..e061fff 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -15,11 +15,11 @@ } // 图片上传 -export function Uploadimg(fileobj) { +export function UploadFile(fileobj) { const param = new FormData() param.append('file', fileobj.file) return request({ - url: 'imageUpload', + url: 'file/upload', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param diff --git a/src/components/wangeditor/wangeditor.vue b/src/components/wangeditor/wangeditor.vue index 9961069..d89a499 100644 --- a/src/components/wangeditor/wangeditor.vue +++ b/src/components/wangeditor/wangeditor.vue @@ -33,7 +33,6 @@ 'underline', // 下划线 'strikeThrough', // 删除线 'foreColor', // 文字颜色 - 'backColor', // 背景颜色 'list', // 列表 'justify', // 对齐方式 'quote', // 引用 @@ -45,12 +44,12 @@ data() { return { editorContent: '', - editor: '' + editor: null } }, watch: { content(val) { - if(val!==this.getContent()){ + if (val !== this.getContent()) { this.setContent(val) } } @@ -62,7 +61,8 @@ initEditor() { var that = this that.editor = new E(that.$refs.editorElem) // 创建富文本实例 - that.editor.customConfig.debug = location.href.indexOf('wangeditor_debug_mode=1') > 0 + that.editor.customConfig.debug = true + debugger that.editor.customConfig.onchange = html => { that.editorContent = html console.log('onchange') @@ -143,10 +143,10 @@ that.editor.create() that.setContent(that.content) }, - getContent: function() { + getContent() { return this.editor.txt.html() }, - setContent: function(content) { + setContent(content) { this.editor.txt.html(content) }, changeContent(content) { diff --git a/src/views/knowledgeManage/editKnowledge.vue b/src/views/knowledgeManage/editKnowledge.vue index a2f2dfa..b371bc1 100644 --- a/src/views/knowledgeManage/editKnowledge.vue +++ b/src/views/knowledgeManage/editKnowledge.vue @@ -1,5 +1,5 @@