diff --git a/scripts/genMaterial.js b/scripts/genMaterial.js index 175d8d68b..7f5da6e61 100644 --- a/scripts/genMaterial.js +++ b/scripts/genMaterial.js @@ -75,7 +75,7 @@ function createNpmConfig(name) { } } -function createWidget(type, key) { +function createWidget(type, _key) { let component = EMPTY_VALUE if (Array.isArray(type) && type.length > 0) { type = type[0] @@ -482,14 +482,15 @@ async function loadBaseDataByMenus(menus, concurrency) { function generateJSONFile(jsonData, fileName = 'output.json', filePath = './') { + const logger = console const jsonString = JSON.stringify(jsonData, null, 2) const fullFilePath = filePath.endsWith('/') ? filePath + fileName : filePath + '/' + fileName fs.writeFile(fullFilePath, jsonString, 'utf8', (err) => { if (err) { - console.error('写入文件时出错:', err) + logger.error('写入文件时出错:', err) } else { - console.log(`JSON 数据已成功写入到文件 ${fullFilePath}`) + logger.log(`JSON 数据已成功写入到文件 ${fullFilePath}`) } }) }