// 获取路由信息
export function getParams(url = window.location.href) {
const theRequest = {};
if (url.indexOf('?') !== -1) {
const str = url.split('?')[1];
const strs = str.split('&');
for (let i = 0; i < strs.length; i += 1) {
theRequest[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1]);
}
}
return theRequest;
}
js 常用工具类utils
最新推荐文章于 2024-03-29 09:39:34 发布