|
@@ -110,12 +110,15 @@ async function createHTMLOfURL (url, config = {}) {
|
|
|
|
|
|
// 保存生成的HTML到文件
|
|
|
const fs = require('fs');
|
|
|
- fs.writeFileSync(outConfig.path, html);
|
|
|
+ // 假设outConfig.path是你要写入的文件路径
|
|
|
+ const safePath = path.posix.normalize(outConfig.path);
|
|
|
+ fs.writeFileSync(safePath, html);
|
|
|
|
|
|
await page.close();
|
|
|
|
|
|
+ logger.log.debug('safePath', safePath)
|
|
|
logger.log.debug('当前时间', new Date().toLocaleString())
|
|
|
- return outConfig.path
|
|
|
+ return safePath
|
|
|
} catch (e) {
|
|
|
logger.log.debug(e)
|
|
|
await page.close();
|