You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
356 B
22 lines
356 B
/**
|
|
* getQueryString 二维码参数转换提取
|
|
* 参数
|
|
* url 二维码参数
|
|
* name 需要提取的参数
|
|
*/
|
|
function getQueryString(url, name) {
|
|
let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)",'i');
|
|
var r = url.substr(1).match(reg)
|
|
|
|
if (r != null) {
|
|
|
|
return r[2]
|
|
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
export {
|
|
getQueryString
|
|
}
|