myBlogs
2024/12/293 mins read
See this issue test
这里是测试Issue博客
这是占位
这是占位
# 锚点1
这是占位
这是占位
这是占位
这是占位
这是占位
这是占位
这是占位
这是占位
这是占位
Header | Header | Header | Header | Header |
---|---|---|---|---|
Cell | Cell | Cell | Cell | Cell aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
Cell | Cell | Cell | Cell | Cell |
Cell | Cell | Cell | Cell | Cell |
Cell | Cell | Cell | Cell | Cell |
Cell | Cell | Cell | Cell | Cell |
export function addSearchParamsToURL(url: string, params?: Record<string, any>) {
if (!params) return url
const searchParams = new URLSearchParams()
// 将参数添加到 URLSearchParams 对象中
for (const key in params)
searchParams.append(key, params[key])
// 将 URLSearchParams 对象添加到 URL 中
const urlObject = new URL(url)
urlObject.search = searchParams.toString()
return urlObject.toString()
}
export function buildQueryString(obj: any) {
let queryString = ''
for (const key in obj)
queryString += `+${key}:${obj[key]}`
return queryString
}