pref(componentEnv): 优化环境测试消息提示逻辑

master
钟良源 2 months ago
parent ec6569a8ab
commit 2dd5786d50

@ -205,10 +205,12 @@ const ComponentEnv = () => {
// 环境测试处理函数 // 环境测试处理函数
const handleTestEnv = async (record: any) => { const handleTestEnv = async (record: any) => {
setLoadingActions({ id: record.id, action: 'test' }); setLoadingActions({ id: record.id, action: 'test' });
const loadingMessage = Message.loading(`正在测试环境 ${record.name}...`); Message.loading({
content: `正在测试环境 ${record.name}...`,
duration: 0
});
try { try {
const res: any = await testEnv(record.id); const res: any = await testEnv(record.id);
loadingMessage();
if (res.code === 200 && res.data) { if (res.code === 200 && res.data) {
Notification.success({ Notification.success({
closable: false, closable: false,
@ -224,6 +226,7 @@ const ComponentEnv = () => {
}); });
} }
} finally { } finally {
Message.clear();
setLoadingActions({ id: null, action: null }); setLoadingActions({ id: null, action: null });
} }
}; };

Loading…
Cancel
Save