|
@@ -58,11 +58,14 @@ async function createHTMLOfURL (url, config = {}) {
|
|
|
}, config)
|
|
|
// 文件路径
|
|
|
const outPath = path.join(PATH_FILES, config.dir)
|
|
|
- if (!fs.existsSync(outPath)) {
|
|
|
- fs.mkdirSync(outPath);
|
|
|
- }
|
|
|
+
|
|
|
const outConfig = Object.assign({path: `${config.filename}.html`, width: config.width, height: config.height,printBackground: true }, config)
|
|
|
outConfig.path = path.join(outPath, outConfig.path)
|
|
|
+
|
|
|
+ const outFilePath = outConfig.path.slice(0, outConfig.path.lastIndexOf('/'))
|
|
|
+ if (!fs.existsSync(outFilePath)) {
|
|
|
+ fs.mkdirSync(outFilePath);
|
|
|
+ }
|
|
|
// 检查缓存
|
|
|
if (!config.nocache) {
|
|
|
const result = checkCache(outConfig.path)
|