handlesubmit(e){
e.preventDefault();
let remark = this.state.textareaData
let record_id = this.state.id
let data = {'remark' : remark,'record_id' : record_id}
if (!remark.trim()) {return}
fetch(`${config.baseUrl}/op-change`, {
method: "POST",
body: JSON.stringify(data),
headers: {
"Content-Type": "application/json"
},
credentials: "same-origin"
}).then(function(response) {
if(response.status == (404 || 500)){
Toast.info('网络错误', 1);
}else{
Toast.info('提交成功', 1);
***history.push('/',null);***
}
return response.text()
}, function(error) {
})
}
<Button type="submit" className="btn" onClick={e => {this.handlesubmit(e)}}>提交</Button>
提交后URL改变了,但是没有刷新,需要手动刷新,需要怎么解决提交后自动刷新?
是什么history跳转啊