state是要传的参数 url是地址 使用window.history.pushState进行跳转 window.location.href=url是为了如果想在当前页面再跳一下当前页面
const state = { id: item.info.id };
const url = '/paasportal/api-service-platform/home/apiDetail';
window.history.pushState(state, '', url);
window.location.href = url;
用window.history.state获取传过来的state参数
const state = window.history.state;
const id = state ? state.id : undefined;
console.log(id);