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.

25 lines
635 B

4 years ago
var express = require('express');
var router = express.Router();
var Mock = require("mockjs")
var moment = require('moment')
var util=require('../../public/javascripts/util')
//获取主页信息
router.get('/main',function(req, res, next) {
var data=Mock.mock({
code:200,
message:'获取主页信息成功',
result:'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