修复:文件名包含特殊符号时导致下载失败的Bug

This commit is contained in:
lyswhut
2019-09-10 13:00:55 +08:00
parent a432080141
commit 16149fdd38
3 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -22,6 +22,8 @@ const state = {
const dls = {}
const tryNum = {}
const filterFileName = /[\\/:*?#"<>|]/g
// getters
const getters = {
list: state => state.list || [],
@@ -125,7 +127,7 @@ const actions = {
url: null,
fileName: `${rootState.setting.download.fileName
.replace('歌名', musicInfo.name)
.replace('歌手', musicInfo.singer)}.${ext}`,
.replace('歌手', musicInfo.singer)}.${ext}`.replace(filterFileName, ''),
progress: {
downloaded: 0,
total: 0,