解决内容为空的问题

This commit is contained in:
2020-07-18 17:46:34 +08:00
parent 9add042253
commit f85dddf4b8
3 changed files with 19 additions and 12 deletions

View File

@ -290,7 +290,6 @@ export default {
'export',
'outline',
'preview',
'format',
'devtools'
]
}],
@ -339,7 +338,6 @@ export default {
'export',
'outline',
'preview',
'format',
'devtools'
]
}],
@ -485,6 +483,15 @@ export default {
}
const editorObj = type === 'editor-reply' ? window.editorReplyObj : window.editorObj
const content = editorObj.getValue()
if (!content || content === '\n') {
this.$toasted.show('请输入内容', {
position: 'top-center',
duration: 5000
})
return
}
const { data } = await this.$axios({
method: 'post',
@ -496,7 +503,7 @@ export default {
postID,
lastID,
parentID,
content: editorObj.getValue()
content
}
})