网址获取某一参数

CommonUtils.getQueryString = (name) = > {
    let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    let r = window.location.search.substr(1).match(reg);
    if (r != null) return decodeURI(r[2]);
    return null;
};

你可能感兴趣的:(网址获取某一参数)