fix:文章修改图片不显示问题

This commit is contained in:
不做码农 2022-07-18 20:03:44 +08:00
parent c678c04e68
commit e309fd6bcb

View File

@ -70,12 +70,12 @@ const data = reactive({
tags: undefined, tags: undefined,
cid: undefined, cid: undefined,
content: undefined, content: undefined,
status: undefined, status: undefined
}, },
rules: { rules: {
title: [{ required: true, message: '标题不能为空', trigger: 'blur' }], title: [{ required: true, message: '标题不能为空', trigger: 'blur' }],
content: [{ required: true, message: '内容不能为空', trigger: 'blur' }], content: [{ required: true, message: '内容不能为空', trigger: 'blur' }]
}, }
}) })
const { form, rules } = toRefs(data) const { form, rules } = toRefs(data)
@ -104,7 +104,7 @@ async function onUploadImg(files, callback) {
.then((res) => rev(res)) .then((res) => rev(res))
.catch((error) => rej(error)) .catch((error) => rej(error))
}) })
}), })
) )
callback(res.map((item) => item.data.url)) callback(res.map((item) => item.data.url))
@ -157,7 +157,6 @@ function handleInputConfirm() {
inputVisible.value = false inputVisible.value = false
inputValue.value = '' inputValue.value = ''
} }
getInfo(cid)
function getInfo(cid) { function getInfo(cid) {
if (!cid || cid == undefined) return if (!cid || cid == undefined) return
getArticle(cid).then((res) => { getArticle(cid).then((res) => {
@ -169,11 +168,13 @@ function getInfo(cid) {
title: data.title, title: data.title,
content: data.content, content: data.content,
category_Id: data.category_Id, category_Id: data.category_Id,
dynamicTags: data.tags != null && data.tags.length > 0 ? data.tags.split(',') : [], coverUrl: data.coverUrl,
dynamicTags: data.tags != null && data.tags.length > 0 ? data.tags.split(',') : []
} }
} }
}) })
} }
getInfo(cid)
getCategoryTreeselect() getCategoryTreeselect()
</script> </script>
<style scoped> <style scoped>