0
点赞
收藏
分享

微信扫一扫

url处理

闲嫌咸贤 2022-09-29 阅读 45


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;
};

举报

相关推荐

0 条评论