Commit 6590508b by zhanghaozhe

添加获取参数helper

parent 475890b6
......@@ -50,4 +50,11 @@ export const isPhone = ($poneInput) => {
} else {
return false;
}
}
\ No newline at end of file
}
export const getParam = (key, str) => {
const _s = str ? str : location.href;
const re = new RegExp(`(?:\\?|#|&)(${key})=([^=&#\\?]+)`, 'ig');
let found;
return (found = re.exec(_s)) ? found[2] : null;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment