Skip to content

Commit

Permalink
解决非法文件名问题
Browse files Browse the repository at this point in the history
  • Loading branch information
niyalishanda committed Apr 6, 2020
1 parent a3150d4 commit fdef1cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions columnArticleList.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ const downloadComment = require('./downloadComment.js');
articleInfo.commentsTotal = commentsTotal;
articleInfo.commentsArr = commentsArr;
};
// 替换文章名称的 / 线, 解决路径被分割的问题
let useArticleTtle = columnArticle.article_title.replace(/\//g, '-');
// 替换非法文件名
let useArticleTtle = columnArticle.article_title.replace(/[\/:*?"<>|]/g, '-');
//生成PDF
await generaterPdf(articleInfo,
useArticleTtle + '.pdf',
Expand Down

0 comments on commit fdef1cd

Please sign in to comment.