|
@ -148,12 +148,16 @@ const onSubmit = async () => { |
|
|
console.log('表单验证通过') |
|
|
console.log('表单验证通过') |
|
|
try { |
|
|
try { |
|
|
form.userId = useUserStore().userId |
|
|
form.userId = useUserStore().userId |
|
|
await useArticleStore().addArticle(form) |
|
|
|
|
|
|
|
|
let res = await useArticleStore().addArticle(form) |
|
|
|
|
|
if (res.status == 200) { |
|
|
ElMessage.success('发表成功!') |
|
|
ElMessage.success('发表成功!') |
|
|
form.articleTitle = '' |
|
|
form.articleTitle = '' |
|
|
form.articleContent = '' |
|
|
form.articleContent = '' |
|
|
form.voteStatus = false |
|
|
form.voteStatus = false |
|
|
clearVoteInfomation() |
|
|
clearVoteInfomation() |
|
|
|
|
|
} else { |
|
|
|
|
|
ElMessage.error('发布失败,请重试!') |
|
|
|
|
|
} |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
ElMessage.error('发布失败,请重试!') |
|
|
ElMessage.error('发布失败,请重试!') |
|
|
console.log(error) |
|
|
console.log(error) |
|
|