docs(readme): add doc

This commit is contained in:
zhangheng
2026-07-14 15:20:54 +08:00
parent c6bedbcff8
commit 958f23a16a
6 changed files with 501 additions and 17 deletions

View File

@@ -13,15 +13,7 @@ export const validatePhoneNumber = (str: string) => {
/** 获取 url 中的某个参数值 */
export const getQueryVariable = (variable: string) => {
if (typeof window === 'undefined') return false
const query = window.location.search.substring(1)
const vars = query.split('&')
for (let i = 0; i < vars.length; i++) {
const pair = vars[i].split('=')
if (pair[0] === variable) {
return pair[1]
}
}
return false
return new URLSearchParams(window.location.search).get(variable) || false
}
/** 加载飞书二维码 SDK */