update mock demo
This commit is contained in:
parent
53154c59b9
commit
48ed9b9fcf
|
@ -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 = [
|
const random_endpoints = [
|
||||||
{
|
{
|
||||||
os: 'Windows',
|
os: 'Windows',
|
||||||
|
@ -5,7 +15,8 @@ const random_endpoints = [
|
||||||
ip: '192.168.3.1',
|
ip: '192.168.3.1',
|
||||||
status: "active", //active/inactive/unmonitored
|
status: "active", //active/inactive/unmonitored
|
||||||
last_active: "2020-03-21 11:12:33",
|
last_active: "2020-03-21 11:12:33",
|
||||||
tag: ["win10"]
|
tag: ["win10"],
|
||||||
|
test: data
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
os: "Linux",
|
os: "Linux",
|
||||||
|
@ -22,6 +33,9 @@ const random_endpoints = [
|
||||||
|
|
||||||
let random_endpoint_pick = 0;
|
let random_endpoint_pick = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
'get /endpoints/get_endpoints': function (req, res) {
|
'get /endpoints/get_endpoints': function (req, res) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue