修复 tx 歌单搜索名字、描述出现乱码的问题(#2250)

This commit is contained in:
lyswhut
2025-02-04 23:20:51 +08:00
parent 68b32a20a4
commit 3ac6d0ff5f
6 changed files with 12 additions and 19 deletions
-13
View File
@@ -71,19 +71,6 @@ export const formatPlayTime2 = (time: number) => {
}
const encodeNames = {
' ': ' ',
'&': '&',
'&lt;': '<',
'&gt;': '>',
'&quot;': '"',
'&apos;': "'",
'&#039;': "'",
} as const
export const decodeName = (str: string | null = '') => {
return str?.replace(/(?:&amp;|&lt;|&gt;|&quot;|&apos;|&#039;|&nbsp;)/gm, (s: string) => encodeNames[s as keyof typeof encodeNames]) ?? ''
}
export const isUrl = (path: string) => /https?:\/\//.test(path)
// 解析URL参数为对象