From 9c5b1a033a4653fe91402482b4ab8ac216cb3a60 Mon Sep 17 00:00:00 2001 From: anyanfei <87066062@qq.com> Date: Wed, 15 Apr 2026 13:40:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(import=20connect)=EF=BC=9A=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E6=96=87=E6=A1=88?= =?UTF-8?q?=EF=BC=9B=E4=BB=85=E5=88=A4=E6=96=ADmysql-workbench-xml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.tsx | 2 +- frontend/src/utils/connectionModalPresentation.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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