Win文件名中存在#特殊字符时无法正常播放 (#2862)

(cherry picked from commit 890b6ea3da)
This commit is contained in:
啊呜
2026-06-14 20:34:42 +08:00
committed by GitHub
parent e0575fc179
commit 33742bca6b

View File

@@ -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
}