fix(parser): 完善了一下

This commit is contained in:
BTMuli
2023-03-31 00:27:32 +08:00
parent c2af95920f
commit f09a474d07
2 changed files with 24 additions and 5 deletions

View File

@@ -30,9 +30,15 @@ onMounted(async () => {
}
// 获取数据
loadingTitle.value = "正在获取数据...";
const postData = await MysOper.Post.get(post_id);
loadingTitle.value = "正在渲染数据...";
postHtml.value = MysOper.Post.parser(postData.post.structured_content);
try {
const postData = await MysOper.Post.get(post_id);
loadingTitle.value = "正在渲染数据...";
postHtml.value = MysOper.Post.parser(postData.post.structured_content);
} catch (error) {
loadingEmpty.value = true;
loadingTitle.value = "帖子不存在或解析失败";
return;
}
setInterval(() => {
loading.value = false;
}, 200);