From 48ed9b9fcf784f2d0389d06aec6fa5864318a14b Mon Sep 17 00:00:00 2001 From: medcl Date: Sun, 22 Mar 2020 13:34:56 +0800 Subject: [PATCH] update mock demo --- app/web/mock/endpoints/api.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/web/mock/endpoints/api.js b/app/web/mock/endpoints/api.js index 6ce49de6..22892e07 100644 --- a/app/web/mock/endpoints/api.js +++ b/app/web/mock/endpoints/api.js @@ -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", @@ -21,6 +32,9 @@ const random_endpoints = [ ]; let random_endpoint_pick = 0; + + + export default { 'get /endpoints/get_endpoints': function (req, res) {