diff --git a/gofaster/app/plugins/modules/api-collector.js b/gofaster/app/plugins/modules/api-collector.js index 3ee65e8..446ea86 100644 --- a/gofaster/app/plugins/modules/api-collector.js +++ b/gofaster/app/plugins/modules/api-collector.js @@ -40,7 +40,6 @@ class ApiCollector { // 如果无法从配置文件获取,返回空字符串(使用相对路径) return '' } catch (error) { - console.warn('⚠️ 无法获取API基础URL,使用相对路径:', error.message) return '' } } @@ -101,7 +100,6 @@ class ApiCollector { const serviceApiMappings = this.analyzeServiceFile(servicePath, serviceName, moduleName) moduleApiMappings.push(...serviceApiMappings) } catch (error) { - console.error(`分析服务文件失败: ${serviceFile}`, error.message) } }) @@ -149,7 +147,6 @@ class ApiCollector { } }) } catch (error) { - console.error(`❌ 分析服务文件失败: ${servicePath}`, error.message) } return apiMappings @@ -249,7 +246,6 @@ class ApiCollector { } } } catch (error) { - console.error(`❌ 解析注解失败: ${servicePath}`, error.message) } return null diff --git a/gofaster/app/plugins/modules/component-relationship-analyzer-ast.js b/gofaster/app/plugins/modules/component-relationship-analyzer-ast.js index afe5187..68a2203 100644 --- a/gofaster/app/plugins/modules/component-relationship-analyzer-ast.js +++ b/gofaster/app/plugins/modules/component-relationship-analyzer-ast.js @@ -39,14 +39,12 @@ class ComponentRelationshipAnalyzerAST { ...component })) - console.log(`🔍 开始分析组件关系,触发源组件数量: ${triggerSourceComponents.length}`) // 为每个触发源组件分析其与顶级组件的关系 triggerSourceComponents.forEach(triggerComponent => { this.analyzeComponentToTopLevel(triggerComponent, topLevelComponents) }) - console.log(`🔍 分析完成,找到 ${this.componentRelationships.length} 个组件关系`) return this.componentRelationships } @@ -96,7 +94,6 @@ class ComponentRelationshipAnalyzerAST { // 避免重复处理同一个触发源 if (this.processedComponents.has(triggerKey)) { - console.log(` ⏭️ 跳过重复处理: ${triggerKey}`) return } @@ -204,7 +201,6 @@ class ComponentRelationshipAnalyzerAST { viewFiles.forEach(file => { const componentName = file.replace('.vue', '') if (this.componentReferencesTargetAST(viewsPath, file, targetComponent)) { - console.log(`🔍 找到父组件: ${moduleName}:${componentName} -> ${targetComponent.module}:${targetComponent.component}`) parents.push({ component: componentName, module: moduleName, @@ -221,7 +217,6 @@ class ComponentRelationshipAnalyzerAST { componentFiles.forEach(file => { const componentName = file.replace('.vue', '') if (this.componentReferencesTargetAST(componentsPath, file, targetComponent)) { - console.log(`🔍 找到父组件: ${moduleName}:${componentName} -> ${targetComponent.module}:${targetComponent.component}`) parents.push({ component: componentName, module: moduleName, diff --git a/gofaster/app/plugins/modules/data-cleaner.js b/gofaster/app/plugins/modules/data-cleaner.js index 400fc39..cca5695 100644 --- a/gofaster/app/plugins/modules/data-cleaner.js +++ b/gofaster/app/plugins/modules/data-cleaner.js @@ -34,7 +34,6 @@ class DataCleaner { return cleanedMappings } catch (error) { - console.error('❌ 清理数据结构失败:', error.message) return null } } diff --git a/gofaster/app/plugins/modules/trigger-analyzer-simple.js b/gofaster/app/plugins/modules/trigger-analyzer-simple.js index 7e092fa..9479f9a 100644 --- a/gofaster/app/plugins/modules/trigger-analyzer-simple.js +++ b/gofaster/app/plugins/modules/trigger-analyzer-simple.js @@ -95,7 +95,6 @@ class TriggerAnalyzerSimple { } } } catch (error) { - console.warn(`获取模块组件时出错: ${error.message}`) } return components diff --git a/gofaster/app/plugins/modules/trigger-analyzer.js b/gofaster/app/plugins/modules/trigger-analyzer.js index 16cc850..46d1886 100644 --- a/gofaster/app/plugins/modules/trigger-analyzer.js +++ b/gofaster/app/plugins/modules/trigger-analyzer.js @@ -98,7 +98,6 @@ class TriggerAnalyzer { }) } } catch (error) { - console.warn(`分析模块 ${moduleName} 时出错:`, error.message) } // 去重 @@ -522,7 +521,6 @@ class TriggerAnalyzer { }) } } catch (error) { - console.warn(`扫描模块 ${moduleDir} 的组件时出错:`, error.message) } } @@ -557,7 +555,6 @@ class TriggerAnalyzer { } } } catch (error) { - console.warn(`获取组件 ${componentName} 的authType时出错:`, error.message) } return null @@ -618,7 +615,6 @@ class TriggerAnalyzer { }) } catch (error) { - console.warn(`分析组件 ${filePath} 时出错:`, error.message) } return triggerSources @@ -645,7 +641,6 @@ class TriggerAnalyzer { return ast } catch (error) { - console.warn('解析Vue组件脚本时出错:', error.message) return null } } @@ -903,7 +898,6 @@ class TriggerAnalyzer { } } catch (error) { - console.warn(`追溯可视组件时出错:`, error.message) } return null @@ -967,7 +961,6 @@ class TriggerAnalyzer { return this.findEventBindingInTemplate(templateAst, methodName, componentName, filePath) } catch (error) { - console.warn(`解析Vue模板时出错:`, error.message) return null } } @@ -1249,7 +1242,6 @@ class TriggerAnalyzer { // 获取节点的位置信息 const loc = node.loc if (!loc) { - console.warn(`节点没有位置信息,无法添加name属性`) return } @@ -1257,7 +1249,6 @@ class TriggerAnalyzer { const startLine = loc.start.line const startColumn = loc.start.column - console.log(`尝试为第${startLine}行第${startColumn}列的button添加name属性: ${nameValue}`) // 将内容按行分割 const lines = content.split('\n') @@ -1267,7 +1258,6 @@ class TriggerAnalyzer { const lineIndex = startLine - 1 let line = lines[lineIndex] - console.log(`当前行内容: ${line}`) // 在button标签中添加name属性 // 查找button标签的开始位置 @@ -1286,7 +1276,6 @@ class TriggerAnalyzer { const newContent = lines.join('\n') writeFileSync(filePath, newContent, 'utf-8') - console.log(`已为 ${filePath} 中的button添加name属性: ${nameValue}`) } else { // 如果button标签跨行,查找button开始标签 const buttonStartMatch = line.match(/]*$/) @@ -1303,16 +1292,12 @@ class TriggerAnalyzer { const newContent = lines.join('\n') writeFileSync(filePath, newContent, 'utf-8') - console.log(`已为 ${filePath} 中的跨行button添加name属性: ${nameValue}`) } else { - console.warn(`未找到button标签`) } } } else { - console.warn(`行号超出范围: ${startLine}`) } } catch (error) { - console.warn(`为Vue文件添加name属性时出错:`, error.message) } } diff --git a/gofaster/app/plugins/route-mapping-plugin.js b/gofaster/app/plugins/route-mapping-plugin.js index 6447b99..53fadf8 100644 --- a/gofaster/app/plugins/route-mapping-plugin.js +++ b/gofaster/app/plugins/route-mapping-plugin.js @@ -12,15 +12,7 @@ const ComponentRelationshipAnalyzerAST = require('./modules/component-relationsh * 收集直接映射关系 */ function routeMappingPlugin() { - // 检查是否在静默模式下运行 - const isSilentMode = process.env.ROUTE_MAPPING_SILENT === 'true' || process.argv.includes('--silent') - // 日志函数 - const log = (message) => { - if (!isSilentMode) { - console.log(message) - } - } return { name: 'route-mapping-phase1', @@ -175,7 +167,6 @@ function routeMappingPlugin() { } catch (error) { this._generationInProgress = false - console.error('❌ 生成direct-route-mappings.js时出错:', error) throw error } } diff --git a/gofaster/app/src/renderer/modules/route-sync/direct-route-mappings.js b/gofaster/app/src/renderer/modules/route-sync/direct-route-mappings.js index c6be9d8..5813fda 100644 --- a/gofaster/app/src/renderer/modules/route-sync/direct-route-mappings.js +++ b/gofaster/app/src/renderer/modules/route-sync/direct-route-mappings.js @@ -252,7 +252,7 @@ export default { "id": 15, "component": "PasswordChangeModal", "module": "user-management", - "triggerName": "passwordchangemodal-input-0xe3cd", + "triggerName": "passwordchangemodal-input-l447v0", "triggerType": "input" } ]