TODO:可信代码库-屏蔽所有Message.error
This commit is contained in:
@@ -164,7 +164,7 @@ export const injectRouter = (router) => {
|
|||||||
return { name: '403' };
|
return { name: '403' };
|
||||||
}
|
}
|
||||||
|
|
||||||
Message.error(repoRes?.error?.error_message);
|
// Message.error(repoRes?.error?.error_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. role信息处理
|
// 2. role信息处理
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ const proxyService = (params: any, customConfigs?: CustomConfigs) => {
|
|||||||
// 网络连接超时
|
// 网络连接超时
|
||||||
const timeoutRegx = /\btimeout\b/;
|
const timeoutRegx = /\btimeout\b/;
|
||||||
if (error?.message && timeoutRegx.test(error.message)) {
|
if (error?.message && timeoutRegx.test(error.message)) {
|
||||||
Message.error('网络连接超时');
|
// Message.error('网络连接超时');
|
||||||
}
|
}
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ async function getMalwareDetails(id) {
|
|||||||
malwareDetails.value = res.data.records[0];
|
malwareDetails.value = res.data.records[0];
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Message.error('接口错误,查询详情失败');
|
// Message.error('接口错误,查询详情失败');
|
||||||
}
|
}
|
||||||
getCurrentPageData();
|
getCurrentPageData();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,10 +213,10 @@ async function getMalwareList() {
|
|||||||
});
|
});
|
||||||
pager.total = res.data.data.total;
|
pager.total = res.data.data.total;
|
||||||
} else {
|
} else {
|
||||||
Message.error(res.data.msg || '查询恶意代码列表失败');
|
// Message.error(res.data.msg || '查询恶意代码列表失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Message.error('接口错误,查询恶意代码列表失败');
|
// Message.error('接口错误,查询恶意代码列表失败');
|
||||||
}
|
}
|
||||||
searchLoading.value = false;
|
searchLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,10 +213,10 @@ async function getMalwareList() {
|
|||||||
});
|
});
|
||||||
pager.total = res.data.data.total;
|
pager.total = res.data.data.total;
|
||||||
} else {
|
} else {
|
||||||
Message.error(res.data.msg || '查询恶意代码列表失败');
|
// Message.error(res.data.msg || '查询恶意代码列表失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Message.error('接口错误,查询恶意代码列表失败');
|
// Message.error('接口错误,查询恶意代码列表失败');
|
||||||
}
|
}
|
||||||
searchLoading.value = false;
|
searchLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ async function getMalwareDetails(id) {
|
|||||||
malwareDetails.value = res.data.records[0];
|
malwareDetails.value = res.data.records[0];
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Message.error('接口错误,查询详情失败');
|
// Message.error('接口错误,查询详情失败');
|
||||||
}
|
}
|
||||||
getCurrentPageData();
|
getCurrentPageData();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ const getQuestionHistory = async () => {
|
|||||||
dhlsPagination.value.total = data.data.pagination.total || 0;
|
dhlsPagination.value.total = data.data.pagination.total || 0;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Message.error('获取对话历史失败');
|
// Message.error('获取对话历史失败');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ const getQuestionCollection = async () => {
|
|||||||
collectionPagination.value.total = data.data.pagination.total || 0;
|
collectionPagination.value.total = data.data.pagination.total || 0;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Message.error('获取收藏对话失败');
|
// Message.error('获取收藏对话失败');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -353,11 +353,11 @@ const handleDelete = async (conversationIds) => {
|
|||||||
selectedRowKeys.value = []; // 清空选中项
|
selectedRowKeys.value = []; // 清空选中项
|
||||||
emits('loadData')
|
emits('loadData')
|
||||||
} else {
|
} else {
|
||||||
Message.error(res.data.message || '删除失败');
|
// Message.error(res.data.message || '删除失败');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('删除对话失败:', error);
|
console.error('删除对话失败:', error);
|
||||||
Message.error('网络错误,请重试');
|
// Message.error('网络错误,请重试');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// 取消收藏对话
|
// 取消收藏对话
|
||||||
@@ -385,11 +385,11 @@ const toggleCollect = async (conversationIds) => {
|
|||||||
colSelectedRowKeys.value = []; // 清空选中项
|
colSelectedRowKeys.value = []; // 清空选中项
|
||||||
emits('loadData')
|
emits('loadData')
|
||||||
} else {
|
} else {
|
||||||
Message.error(res.data.message || '取消收藏失败');
|
// Message.error(res.data.message || '取消收藏失败');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('收藏操作失败:', error);
|
console.error('收藏操作失败:', error);
|
||||||
Message.error('网络请求失败,请重试');
|
// Message.error('网络请求失败,请重试');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -331,11 +331,11 @@ const confirmEdit = async (item) => {
|
|||||||
item.isEditing = false; // 退出编辑状态
|
item.isEditing = false; // 退出编辑状态
|
||||||
Message.success('标题修改成功');
|
Message.success('标题修改成功');
|
||||||
} else {
|
} else {
|
||||||
Message.error(res.data.message || '修改失败');
|
// Message.error(res.data.message || '修改失败');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('编辑失败:', error);
|
console.error('编辑失败:', error);
|
||||||
Message.error('网络请求失败,请重试');
|
// Message.error('网络请求失败,请重试');
|
||||||
item.tempTitle = item.title; // 回滚临时标题
|
item.tempTitle = item.title; // 回滚临时标题
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -373,11 +373,11 @@ const toggleCollect = async (item) => {
|
|||||||
|
|
||||||
Message.success(res.data.message);
|
Message.success(res.data.message);
|
||||||
} else {
|
} else {
|
||||||
Message.error(res.data.message || '操作失败');
|
// Message.error(res.data.message || '操作失败');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('收藏操作失败:', error);
|
console.error('收藏操作失败:', error);
|
||||||
Message.error('网络请求失败,请重试');
|
// Message.error('网络请求失败,请重试');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -502,11 +502,11 @@ const handleDelete = async (conversationIds, tabType) => {
|
|||||||
Message.success(res.data.message || '删除成功');
|
Message.success(res.data.message || '删除成功');
|
||||||
loadData()
|
loadData()
|
||||||
} else {
|
} else {
|
||||||
Message.error(res.data.message || '删除失败');
|
// Message.error(res.data.message || '删除失败');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('删除对话失败:', error);
|
console.error('删除对话失败:', error);
|
||||||
Message.error('网络错误,请重试');
|
// Message.error('网络错误,请重试');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ const exportResult = async () => {
|
|||||||
} else {
|
} else {
|
||||||
console.error('导出失败:', error);
|
console.error('导出失败:', error);
|
||||||
// 这里可以添加错误提示,比如使用Element Plus的ElMessage
|
// 这里可以添加错误提示,比如使用Element Plus的ElMessage
|
||||||
ElMessage.error('文件导出失败');
|
// ElMessage.error('文件导出失败');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -486,11 +486,11 @@ const createConversation = async () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Message.error('创建会话失败,未获取到会话ID');
|
// Message.error('创建会话失败,未获取到会话ID');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('创建会话失败:', error);
|
console.error('创建会话失败:', error);
|
||||||
Message.error('创建会话失败,请重试');
|
// Message.error('创建会话失败,请重试');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// 猜你想问接口
|
// 猜你想问接口
|
||||||
@@ -559,7 +559,7 @@ const getConversationDetail = async (convId: string) => {
|
|||||||
conversationId: convId,
|
conversationId: convId,
|
||||||
});
|
});
|
||||||
if(response.data?.error) {
|
if(response.data?.error) {
|
||||||
Message.error(response.data?.error);
|
// Message.error(response.data?.error);
|
||||||
} else {
|
} else {
|
||||||
const detail = response.data.messages;
|
const detail = response.data.messages;
|
||||||
// 处理详情数据(如回显消息列表)
|
// 处理详情数据(如回显消息列表)
|
||||||
@@ -567,7 +567,7 @@ const getConversationDetail = async (convId: string) => {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取会话详情失败:', error);
|
console.error('获取会话详情失败:', error);
|
||||||
Message.error('获取会话详情失败,请重试');
|
// Message.error('获取会话详情失败,请重试');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ async function queryUserInfo() {
|
|||||||
getEnterpriseDetail(res.data?.data.data.enterpriseId);
|
getEnterpriseDetail(res.data?.data.data.enterpriseId);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Message.error('查询用户信息失败');
|
// Message.error('查询用户信息失败');
|
||||||
}
|
}
|
||||||
searchOrganizationLoading.value = false;
|
searchOrganizationLoading.value = false;
|
||||||
}
|
}
|
||||||
@@ -454,7 +454,7 @@ async function createOrganization() {
|
|||||||
if(res.data?.msg === '未登录') {
|
if(res.data?.msg === '未登录') {
|
||||||
RemoveInfo()
|
RemoveInfo()
|
||||||
}
|
}
|
||||||
Message.error(res.data?.msg || '创建失败');
|
// Message.error(res.data?.msg || '创建失败');
|
||||||
} else {
|
} else {
|
||||||
closeOrganizationModal();
|
closeOrganizationModal();
|
||||||
// 确保完全重置表单
|
// 确保完全重置表单
|
||||||
@@ -468,7 +468,7 @@ async function createOrganization() {
|
|||||||
searchOrganizationLoading.value = false;
|
searchOrganizationLoading.value = false;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Message.error('接口错误,创建失败');
|
// Message.error('接口错误,创建失败');
|
||||||
}
|
}
|
||||||
createOrganizationLoading.value = false;
|
createOrganizationLoading.value = false;
|
||||||
}
|
}
|
||||||
@@ -511,10 +511,10 @@ async function editOrganizationConfirm() {
|
|||||||
createFormData.organizationName = '';
|
createFormData.organizationName = '';
|
||||||
createFormData.organizationProfile = '';
|
createFormData.organizationProfile = '';
|
||||||
} else {
|
} else {
|
||||||
Message.error(res.data?.msg || '更新失败');
|
// Message.error(res.data?.msg || '更新失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Message.error('接口错误,更新失败');
|
// Message.error('接口错误,更新失败');
|
||||||
}
|
}
|
||||||
editLoading.value = false;
|
editLoading.value = false;
|
||||||
isEdit.value = false;
|
isEdit.value = false;
|
||||||
@@ -543,7 +543,7 @@ async function getMemberList() {
|
|||||||
Message.warning(res.data?.msg || '查询失败');
|
Message.warning(res.data?.msg || '查询失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Message.error('接口错误,查询失败');
|
// Message.error('接口错误,查询失败');
|
||||||
}
|
}
|
||||||
memberListSearchLoading.value = false;
|
memberListSearchLoading.value = false;
|
||||||
}
|
}
|
||||||
@@ -564,7 +564,7 @@ async function getOrgList(username) {
|
|||||||
Message.warning(res.data?.msg || '查询失败');
|
Message.warning(res.data?.msg || '查询失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Message.error('接口错误,查询失败');
|
// Message.error('接口错误,查询失败');
|
||||||
}
|
}
|
||||||
orgListSearchLoading.value = false;
|
orgListSearchLoading.value = false;
|
||||||
}
|
}
|
||||||
@@ -577,10 +577,10 @@ const getEnterpriseDetail = async (id) => {
|
|||||||
if (response.data.code === 200) {
|
if (response.data.code === 200) {
|
||||||
enterpriseDetail.value = response.data.data;
|
enterpriseDetail.value = response.data.data;
|
||||||
} else {
|
} else {
|
||||||
Message.error('数据获取失败');
|
// Message.error('数据获取失败');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Message.error('网络请求失败');
|
// Message.error('网络请求失败');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -700,7 +700,7 @@ async function deleteMember() {
|
|||||||
Message.success('删除成功');
|
Message.success('删除成功');
|
||||||
getMemberList();
|
getMemberList();
|
||||||
} else {
|
} else {
|
||||||
Message.error(res.data?.msg || '删除失败');
|
// Message.error(res.data?.msg || '删除失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Message.warning('接口错误,删除失败');
|
Message.warning('接口错误,删除失败');
|
||||||
|
|||||||
@@ -224,11 +224,11 @@ const beforeUpload = async (file) => {
|
|||||||
Message.success('图片上传成功');
|
Message.success('图片上传成功');
|
||||||
} else {
|
} else {
|
||||||
showUpload.value = true; // 上传失败,恢复上传区域
|
showUpload.value = true; // 上传失败,恢复上传区域
|
||||||
Message.error(response.data.msg || '图片上传失败');
|
// Message.error(response.data.msg || '图片上传失败');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showUpload.value = true; // 网络错误,恢复上传区域
|
showUpload.value = true; // 网络错误,恢复上传区域
|
||||||
Message.error('图片上传网络失败,请重试');
|
// Message.error('图片上传网络失败,请重试');
|
||||||
console.error('图片上传异常:', error);
|
console.error('图片上传异常:', error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,10 +337,10 @@ const handleConfirm = async () => {
|
|||||||
// 通知父组件刷新列表(可通过事件实现)
|
// 通知父组件刷新列表(可通过事件实现)
|
||||||
emits('refresh');
|
emits('refresh');
|
||||||
} else {
|
} else {
|
||||||
Message.error(response.data.msg || '编辑失败,请重试');
|
// Message.error(response.data.msg || '编辑失败,请重试');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Message.error('网络请求失败,请检查网络连接');
|
// Message.error('网络请求失败,请检查网络连接');
|
||||||
console.error('编辑接口异常:', error);
|
console.error('编辑接口异常:', error);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -353,10 +353,10 @@ const handleConfirm = async () => {
|
|||||||
// 通知父组件刷新列表(可通过事件实现)
|
// 通知父组件刷新列表(可通过事件实现)
|
||||||
emits('refresh');
|
emits('refresh');
|
||||||
} else {
|
} else {
|
||||||
Message.error(response.data.msg || '添加失败,请重试');
|
// Message.error(response.data.msg || '添加失败,请重试');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Message.error('网络请求失败,请检查网络连接');
|
// Message.error('网络请求失败,请检查网络连接');
|
||||||
console.error('新增接口异常:', error);
|
console.error('新增接口异常:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -432,7 +432,7 @@ const exportResult = () => {
|
|||||||
document.body.removeChild(link);
|
document.body.removeChild(link);
|
||||||
Message.success('导出成功');
|
Message.success('导出成功');
|
||||||
} catch {
|
} catch {
|
||||||
Message.error('导出失败');
|
// Message.error('导出失败');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -592,7 +592,7 @@ const exportResult = async () => {
|
|||||||
} else {
|
} else {
|
||||||
console.error('导出失败:', error);
|
console.error('导出失败:', error);
|
||||||
// 这里可以添加错误提示,比如使用Element Plus的ElMessage
|
// 这里可以添加错误提示,比如使用Element Plus的ElMessage
|
||||||
ElMessage.error('文件导出失败');
|
// ElMessage.error('文件导出失败');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ async function getMalwareDetails(id) {
|
|||||||
malwareDetails.value = res.data.records[0];
|
malwareDetails.value = res.data.records[0];
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Message.error('接口错误,查询详情失败');
|
// Message.error('接口错误,查询详情失败');
|
||||||
}
|
}
|
||||||
getCurrentPageData();
|
getCurrentPageData();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,10 +213,10 @@ async function getMalwareList() {
|
|||||||
});
|
});
|
||||||
pager.total = res.data.data.total;
|
pager.total = res.data.data.total;
|
||||||
} else {
|
} else {
|
||||||
Message.error(res.data.msg || '查询恶意代码列表失败');
|
// Message.error(res.data.msg || '查询恶意代码列表失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Message.error('接口错误,查询恶意代码列表失败');
|
// Message.error('接口错误,查询恶意代码列表失败');
|
||||||
}
|
}
|
||||||
searchLoading.value = false;
|
searchLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,10 +213,10 @@ async function getMalwareList() {
|
|||||||
});
|
});
|
||||||
pager.total = res.data.data.total;
|
pager.total = res.data.data.total;
|
||||||
} else {
|
} else {
|
||||||
Message.error(res.data.msg || '查询恶意代码列表失败');
|
// Message.error(res.data.msg || '查询恶意代码列表失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Message.error('接口错误,查询恶意代码列表失败');
|
// Message.error('接口错误,查询恶意代码列表失败');
|
||||||
}
|
}
|
||||||
searchLoading.value = false;
|
searchLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ async function getMalwareDetails(id) {
|
|||||||
malwareDetails.value = res.data.records[0];
|
malwareDetails.value = res.data.records[0];
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Message.error('接口错误,查询详情失败');
|
// Message.error('接口错误,查询详情失败');
|
||||||
}
|
}
|
||||||
getCurrentPageData();
|
getCurrentPageData();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -617,7 +617,7 @@ const handleReOpen = () => {
|
|||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
reOpenLoading.value = false;
|
reOpenLoading.value = false;
|
||||||
Message.error(e.error_message);
|
// Message.error(e.error_message);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
/** 获取评审人 */
|
/** 获取评审人 */
|
||||||
|
|||||||
Reference in New Issue
Block a user