This commit is contained in:
tangly1024
2022-03-16 12:20:51 +08:00
parent 3d86afe001
commit ddcf06b0da

View File

@@ -46,12 +46,17 @@ export function GlobalContextProvider ({ children }) {
)
}
/**
* 查询url中的query参数
* @param {}} variable
* @returns
*/
function getQueryVariable (variable) {
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] }
if (pair[0] === variable) { return pair[1] }
}
return (false)
}