TODO:可信代码库-屏蔽所有Message.error
This commit is contained in:
@@ -206,7 +206,7 @@ async function getMalwareDetails(id) {
|
||||
malwareDetails.value = res.data.records[0];
|
||||
}
|
||||
} catch (e) {
|
||||
Message.error('接口错误,查询详情失败');
|
||||
// Message.error('接口错误,查询详情失败');
|
||||
}
|
||||
getCurrentPageData();
|
||||
}
|
||||
|
||||
@@ -213,10 +213,10 @@ async function getMalwareList() {
|
||||
});
|
||||
pager.total = res.data.data.total;
|
||||
} else {
|
||||
Message.error(res.data.msg || '查询恶意代码列表失败');
|
||||
// Message.error(res.data.msg || '查询恶意代码列表失败');
|
||||
}
|
||||
} catch (e) {
|
||||
Message.error('接口错误,查询恶意代码列表失败');
|
||||
// Message.error('接口错误,查询恶意代码列表失败');
|
||||
}
|
||||
searchLoading.value = false;
|
||||
}
|
||||
|
||||
@@ -213,10 +213,10 @@ async function getMalwareList() {
|
||||
});
|
||||
pager.total = res.data.data.total;
|
||||
} else {
|
||||
Message.error(res.data.msg || '查询恶意代码列表失败');
|
||||
// Message.error(res.data.msg || '查询恶意代码列表失败');
|
||||
}
|
||||
} catch (e) {
|
||||
Message.error('接口错误,查询恶意代码列表失败');
|
||||
// Message.error('接口错误,查询恶意代码列表失败');
|
||||
}
|
||||
searchLoading.value = false;
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ async function getMalwareDetails(id) {
|
||||
malwareDetails.value = res.data.records[0];
|
||||
}
|
||||
} catch (e) {
|
||||
Message.error('接口错误,查询详情失败');
|
||||
// Message.error('接口错误,查询详情失败');
|
||||
}
|
||||
getCurrentPageData();
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ const getQuestionHistory = async () => {
|
||||
dhlsPagination.value.total = data.data.pagination.total || 0;
|
||||
}
|
||||
} catch (error) {
|
||||
Message.error('获取对话历史失败');
|
||||
// Message.error('获取对话历史失败');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -255,7 +255,7 @@ const getQuestionCollection = async () => {
|
||||
collectionPagination.value.total = data.data.pagination.total || 0;
|
||||
}
|
||||
} catch (error) {
|
||||
Message.error('获取收藏对话失败');
|
||||
// Message.error('获取收藏对话失败');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -353,11 +353,11 @@ const handleDelete = async (conversationIds) => {
|
||||
selectedRowKeys.value = []; // 清空选中项
|
||||
emits('loadData')
|
||||
} else {
|
||||
Message.error(res.data.message || '删除失败');
|
||||
// Message.error(res.data.message || '删除失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('删除对话失败:', error);
|
||||
Message.error('网络错误,请重试');
|
||||
// Message.error('网络错误,请重试');
|
||||
}
|
||||
};
|
||||
// 取消收藏对话
|
||||
@@ -385,11 +385,11 @@ const toggleCollect = async (conversationIds) => {
|
||||
colSelectedRowKeys.value = []; // 清空选中项
|
||||
emits('loadData')
|
||||
} else {
|
||||
Message.error(res.data.message || '取消收藏失败');
|
||||
// Message.error(res.data.message || '取消收藏失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('收藏操作失败:', error);
|
||||
Message.error('网络请求失败,请重试');
|
||||
// Message.error('网络请求失败,请重试');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -331,11 +331,11 @@ const confirmEdit = async (item) => {
|
||||
item.isEditing = false; // 退出编辑状态
|
||||
Message.success('标题修改成功');
|
||||
} else {
|
||||
Message.error(res.data.message || '修改失败');
|
||||
// Message.error(res.data.message || '修改失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('编辑失败:', error);
|
||||
Message.error('网络请求失败,请重试');
|
||||
// Message.error('网络请求失败,请重试');
|
||||
item.tempTitle = item.title; // 回滚临时标题
|
||||
}
|
||||
};
|
||||
@@ -373,11 +373,11 @@ const toggleCollect = async (item) => {
|
||||
|
||||
Message.success(res.data.message);
|
||||
} else {
|
||||
Message.error(res.data.message || '操作失败');
|
||||
// Message.error(res.data.message || '操作失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('收藏操作失败:', error);
|
||||
Message.error('网络请求失败,请重试');
|
||||
// Message.error('网络请求失败,请重试');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -502,11 +502,11 @@ const handleDelete = async (conversationIds, tabType) => {
|
||||
Message.success(res.data.message || '删除成功');
|
||||
loadData()
|
||||
} else {
|
||||
Message.error(res.data.message || '删除失败');
|
||||
// Message.error(res.data.message || '删除失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('删除对话失败:', error);
|
||||
Message.error('网络错误,请重试');
|
||||
// Message.error('网络错误,请重试');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ const exportResult = async () => {
|
||||
} else {
|
||||
console.error('导出失败:', error);
|
||||
// 这里可以添加错误提示,比如使用Element Plus的ElMessage
|
||||
ElMessage.error('文件导出失败');
|
||||
// ElMessage.error('文件导出失败');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -486,11 +486,11 @@ const createConversation = async () => {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
Message.error('创建会话失败,未获取到会话ID');
|
||||
// Message.error('创建会话失败,未获取到会话ID');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('创建会话失败:', error);
|
||||
Message.error('创建会话失败,请重试');
|
||||
// Message.error('创建会话失败,请重试');
|
||||
}
|
||||
};
|
||||
// 猜你想问接口
|
||||
@@ -559,7 +559,7 @@ const getConversationDetail = async (convId: string) => {
|
||||
conversationId: convId,
|
||||
});
|
||||
if(response.data?.error) {
|
||||
Message.error(response.data?.error);
|
||||
// Message.error(response.data?.error);
|
||||
} else {
|
||||
const detail = response.data.messages;
|
||||
// 处理详情数据(如回显消息列表)
|
||||
@@ -567,7 +567,7 @@ const getConversationDetail = async (convId: string) => {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取会话详情失败:', error);
|
||||
Message.error('获取会话详情失败,请重试');
|
||||
// Message.error('获取会话详情失败,请重试');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user