You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 lines
646 B

var express = require('express');
var router = express.Router();
var Mock = require("mockjs")
var moment = require('moment')
var util=require('../../public/javascripts/util')
var mock=require('../../public/javascripts/mock')
//获取主页信息
router.get('/main',function(req, res, next) {
var data=Mock.mock({...mock.ok('获取主页信息成功'),...{
body:{
ip:Mock.Random.ip(),
'time|3600-36000':0,
lastLoginTime:function (){
return moment(Date.now()-this.time*1000).format(util.dateFormat)
}
}
}})
return res.json(data)
})
module.exports=router