兼容url格式的主题背景图片

This commit is contained in:
lyswhut
2022-10-29 20:25:24 +08:00
parent 07898cdfd6
commit 2003c5a0c9
6 changed files with 47 additions and 23 deletions
+2
View File
@@ -60,6 +60,8 @@ export const decodeName = (str: string | null = '') => {
return str?.replace(/(?:&|<|>|"|'|'| )/gm, (s: string) => encodeNames[s as keyof typeof encodeNames]) ?? ''
}
export const isUrl = (path: string) => /https?:\/\//.test(path)
// 解析URL参数为对象
export const parseUrlParams = (str: string): Record<string, string> => {
const params: Record<string, string> = {}