diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 84301b1..6783724 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1709,7 +1709,7 @@ function App() { try { setPendingConnectionImportPayload(null); const importedViews = await importConnectionsPayload(raw, ''); - if (importedViews.some(v => !v.hasPrimaryPassword)) { + if (importKind === 'mysql-workbench-xml' && importedViews.some(v => !v.hasPrimaryPassword)) { void message.warning(`成功导入 ${importedViews.length} 个连接,部分连接未包含密码,请编辑对应连接并输入密码后保存`); } else { void message.success(`成功导入 ${importedViews.length} 个连接`); diff --git a/frontend/src/utils/connectionModalPresentation.test.ts b/frontend/src/utils/connectionModalPresentation.test.ts index 0f15f6d..2c30b40 100644 --- a/frontend/src/utils/connectionModalPresentation.test.ts +++ b/frontend/src/utils/connectionModalPresentation.test.ts @@ -39,7 +39,7 @@ describe('connectionModalPresentation', () => { reason: 'saved connection not found: conn-1', fallback: '连接失败', })).toEqual({ - message: '测试失败: 未找到当前连接对应的已保存密文,请编辑当前连接,并输入密码后保存', + message: '测试失败: 未找到当前连接对应的已保存密文,请重新填写密码并保存后再试', shouldToast: true, }); }); @@ -54,4 +54,4 @@ describe('connectionModalPresentation', () => { shouldToast: false, }); }); -}); +}); \ No newline at end of file