()
| 193 | |
| 194 | // 从旧目录迁移数据(Documents/ChatLab → userData/data) |
| 195 | migrateDataIfNeeded() { |
| 196 | if (needsLegacyMigration()) { |
| 197 | console.log('[Main] Legacy data migration needed, starting migration...') |
| 198 | const result = migrateFromLegacyDir() |
| 199 | if (result.success) { |
| 200 | console.log(`[Main] Migration completed. Migrated: ${result.migratedDirs.join(', ')}`) |
| 201 | } else { |
| 202 | console.error('[Main] Migration failed:', result.error) |
| 203 | } |
| 204 | } else { |
| 205 | console.log('[Main] No legacy data migration needed') |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | // 从 Electron 旧目录结构迁移到新的双根目录结构 |
| 210 | migrateToUnifiedDirsIfNeeded() { |
no test coverage detected