I use axios to send the request in js. The code is as follows:
handelOne = () = > {
const url = "http://one.json";
axios.get(url,{dataType:"json"})
.then((res) => {
let dataStr = JSON.stringify(res.data);
console.log("1:"+dataStr);
})
The code for the }
mock file is:
Mock.mock ("http://one.json",{
//list1-5
"list|1-5":[{
//sid11
"sid|+1":1,
//userId5
"userId|5":""
}]
//"string|1-10": "" mock
})
the output of the console console is: I am requesting 1: [object,object], why is it not a specific json object but [object,object]