update mock demo

This commit is contained in:
medcl 2020-03-22 13:34:56 +08:00
parent 53154c59b9
commit 48ed9b9fcf
1 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,13 @@
var Mock = require('mockjs')
var data = Mock.mock({
// 属性 list 的值是一个数组,其中含有 1 到 10 个元素
'list|1-10': [{
// 属性 id 是一个自增数,起始值为 1每次增 1
'id|+1': 1
}]
});
const random_endpoints = [
{
os: 'Windows',
@ -5,7 +15,8 @@ const random_endpoints = [
ip: '192.168.3.1',
status: "active", //active/inactive/unmonitored
last_active: "2020-03-21 11:12:33",
tag: ["win10"]
tag: ["win10"],
test: data
},
{
os: "Linux",
@ -22,6 +33,9 @@ const random_endpoints = [
let random_endpoint_pick = 0;
export default {
'get /endpoints/get_endpoints': function (req, res) {