mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/lyswhut/lx-music-desktop.git
synced 2026-09-20 08:04:00 +08:00
Win文件名中存在#特殊字符时无法正常播放
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// 非业务工具方法
|
||||
|
||||
import { pathToFileURL } from 'url'
|
||||
/**
|
||||
* 获取两个数之间的随机整数,大于等于min,小于max
|
||||
* @param {*} min
|
||||
@@ -188,7 +189,7 @@ export const sortInsert = <T>(arr: Array<{ num: number, data: T }>, data: { num:
|
||||
}
|
||||
|
||||
export const encodePath = (path: string) => {
|
||||
return encodeURI(path.replaceAll('\\', '/'))
|
||||
return pathToFileURL(path).href
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user