|
|
@@ -246,29 +246,30 @@ export default {
|
|
|
next()
|
|
|
},
|
|
|
methods: {
|
|
|
- initEditorConfig() {
|
|
|
- const baseURL = process.env.VUE_APP_BASE_API || ''
|
|
|
- const token = localStorage.getItem('token')
|
|
|
- this.editorConfig = {
|
|
|
- MENU_CONF: {
|
|
|
- uploadImage: {
|
|
|
- server: baseURL + '/api/admin/articles/upload/image',
|
|
|
- headers: token ? { Authorization: 'Bearer ' + token } : {},
|
|
|
- maxNumberOfFiles: 1,
|
|
|
- maxFileSize: 5 * 1024 * 1024,
|
|
|
- fieldName: 'file',
|
|
|
- customAlert: (msg, type) => {
|
|
|
- this.$message && this.$message({ message: msg, type: type || 'error' })
|
|
|
- },
|
|
|
- onSuccess(res, insertFn) {
|
|
|
- if (res.code === 200) {
|
|
|
- insertFn(res.data.url || res.data)
|
|
|
+ initEditorConfig() {
|
|
|
+ const baseURL = process.env.VUE_APP_BASE_API || ''
|
|
|
+ const token = localStorage.getItem('token')
|
|
|
+ this.editorConfig = {
|
|
|
+ MENU_CONF: {
|
|
|
+ uploadImage: {
|
|
|
+ server: baseURL + '/api/admin/articles/upload/image',
|
|
|
+ headers: token ? { Authorization: 'Bearer ' + token } : {},
|
|
|
+ maxNumberOfFiles: 1,
|
|
|
+ maxFileSize: 5 * 1024 * 1024,
|
|
|
+ fieldName: 'file',
|
|
|
+ customAlert: (msg, type) => {
|
|
|
+ this.$message && this.$message({ message: msg, type: type || 'error' })
|
|
|
+ },
|
|
|
+ onSuccess(res, insertFn) {
|
|
|
+ if (res.code === 200) {
|
|
|
+ const url = res.data.url || res.data
|
|
|
+ insertFn(baseURL + url)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
+ },
|
|
|
handleEditorCreated(editor) {
|
|
|
this.editorInstance = editor
|
|
|
},
|