$.ajax({
type:"GET",
url:this.url,
dataType:"json",
success:function (result) {
if(result.meta.success===true){
that.setState({contents: result.data});
let content=JSON.stringify(result.data);
localStorage.setItem("searchlists",content);
that.props.history.push( '/srmp/v1/contents',null)
}
},
error:function(xhr,status, err) {
console.error( status, err.toString());
// hashHistory.push('/srmp/v1/contents')
// const win = window.open('/srmp/v1/contents', '_blank');
// win.focus();
// browserHistory.push('/srmp/v1/contents');
// that.props.history.push( '/srmp/v1/contents',null)
}
});
加红色的这句话javascript
第一个参数是跳转路由,pathjava
第二个参数是state,想要传入的参数ajax
路由传参的三种方法json