console
var requestURL = 'http://jsrun.net';
var option = {
'list|8': [
{
"id|+1": 1,
"workflowId|+1": 1,
"fileName": "@name",
"creater": "@name",
fileType: "png",
category: "img",
status: [true, true, true, false, false, false],
"updateTime": "@datetime",
"createTime": "@datetime"
}
]
};
Mock.mock(requestURL, option);
$.ajax({
url: requestURL,
dataType: 'json',
success: function (data) {
var code = '<pre>$code</pre>';
code = code.replace('$code', JSON.stringify(data, null, 2));
$('#cmd').html(code);
}
});
<div id="cmd"></div>
* {
margin: 0;
padding: 0;
font-size: 12px;
}
html, body {
height: 100%;
}
#cmd {
width: 100%;
height: 100%;
}