refactor(biji-qianduan): 优化错误处理和数据赋值

- 移除了多余的错误处理代码
- 优化了 searchMarkdown 函数的返回值处理- 删除了不必要的空行和分号
This commit is contained in:
ikmkj
2025-08-06 23:51:40 +08:00
parent 72c916da4d
commit 91935baa6f

View File

@@ -457,11 +457,9 @@ const fetchGroupings = async () => {
const allCategories = await groupingAll("");
categoryTree.value = buildTree(allCategories || []);
} catch (error) {
console.error('获取分组失败:', error);
ElMessage.error('获取分组失败: ' + error.message);
categoryTree.value = [];
}
};
}
const selectFile = async (data) => {
try {
@@ -864,7 +862,7 @@ const handleSearch = async () => {
}
try {
const response = await searchMarkdown(searchKeyword.value);
groupMarkdownFiles.value = response.data || [];
groupMarkdownFiles.value = response || [];
} catch (error) {
ElMessage.error('搜索失败: ' + error.message);
}