|
1 | | -import {getMongoManager, getMongoRepository, Like, Between, FindManyOptions, Equal} from "typeorm"; |
2 | | -import * as Moment from 'moment' |
| 1 | +import {getMongoManager, getMongoRepository, Like, Between, FindManyOptions, Equal} from 'typeorm'; |
3 | 2 | import { Context } from '@core/koa' |
4 | 3 | import { API } from '../entities/mongo/api' |
5 | 4 | import { Errors } from '../entities/mongo/errors' |
6 | | -import { Guid } from "../utils/tools"; |
| 5 | +import { Guid } from '../utils/tools'; |
7 | 6 | import { CONNECT_MONGO } from '../database/dbUtils' |
| 7 | +import { formatDate } from '../utils/tools'; |
| 8 | +import { DateFormat } from '../types/base'; |
8 | 9 |
|
9 | 10 |
|
10 | 11 | export default class LogsController { |
@@ -78,7 +79,7 @@ export default class LogsController { |
78 | 79 | model.resHeaders = ctx.response.header |
79 | 80 | model.resData = ctx.body |
80 | 81 | model.protocol = ctx.protocol; |
81 | | - model.createdAt = Moment(Date.now()).format('YYYY/MM/DD HH:mm:ss.SSS') |
| 82 | + model.createdAt = formatDate(new Date, DateFormat.DateTimeS) |
82 | 83 | model.createdBy = ctx.state['CUR_USER'] ? ctx.state['CUR_USER'].id : model.ip |
83 | 84 |
|
84 | 85 | model.method = method |
@@ -113,7 +114,7 @@ export default class LogsController { |
113 | 114 | model.resHeaders = ctx.response.header |
114 | 115 | model.resData = ctx.body |
115 | 116 | model.protocol = ctx.protocol; |
116 | | - model.createdAt = Moment(Date.now()).format('YYYY/MM/DD HH:mm:ss.SSS') |
| 117 | + model.createdAt = formatDate(new Date, DateFormat.DateTimeS) |
117 | 118 | model.createdBy = ctx.state['CUR_USER'] ? ctx.state['CUR_USER'].id : model.ip |
118 | 119 |
|
119 | 120 | model.status = options.status |
|
0 commit comments