const getUrl = key => {
let result = null;
const url = window.location.href.split(`?`);
if (url.length > 1) {
url[1].split(`&`).map(item => {
const res = item.split(`=`);
if (res[0] === key) {
result = res[1];
}
});
}
return result;
};
微信扫一扫
const getUrl = key => {
let result = null;
const url = window.location.href.split(`?`);
if (url.length > 1) {
url[1].split(`&`).map(item => {
const res = item.split(`=`);
if (res[0] === key) {
result = res[1];
}
});
}
return result;
};
相关推荐