Skip to content

Commit fdef1cd

Browse files
committed
解决非法文件名问题
1 parent a3150d4 commit fdef1cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

columnArticleList.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ const downloadComment = require('./downloadComment.js');
5656
articleInfo.commentsTotal = commentsTotal;
5757
articleInfo.commentsArr = commentsArr;
5858
};
59-
// 替换文章名称的 / 线, 解决路径被分割的问题
60-
let useArticleTtle = columnArticle.article_title.replace(/\//g, '-');
59+
// 替换非法文件名
60+
let useArticleTtle = columnArticle.article_title.replace(/[\/:*?"<>|]/g, '-');
6161
//生成PDF
6262
await generaterPdf(articleInfo,
6363
useArticleTtle + '.pdf',

0 commit comments

Comments
 (0)