試圖使用Mockjs攔截post請(qǐng)求,獲取到的option.body貌似是個(gè)字符串,例如這樣:{
url: "http://test.cn/entity/save",
type: "POST",
body: "name=abc&type=1"}請(qǐng)問(wèn)是否有什么設(shè)置能保證能直接獲取成json,比如下面這樣{
url: "http://test.cn/entity/save",
type: "POST",
body: {
name: "abc",
type: 1
}
}
Mockjs 攔截post請(qǐng)求后,參數(shù)是否可以直接設(shè)定為json格式?
ibeautiful
2018-07-23 09:38:39