diff --git a/utils/impl/koaresp.js b/utils/impl/koaresp.js index 3b37361..4bdac45 100644 --- a/utils/impl/koaresp.js +++ b/utils/impl/koaresp.js @@ -1,5 +1,7 @@ 'use strict'; +const Moment = require('moment'); + function ctxresp(ctx, data, errno, errmsg) { if (errno === null || errno === undefined) errno = 0; if (errmsg === null || errmsg === undefined) errmsg = ''; @@ -8,7 +10,8 @@ function ctxresp(ctx, data, errno, errmsg) { ctx.body = { result: errno === 0 ? 'ok' : 'fail', error: { code: errno, msg: errmsg }, - data: data + data: data, + stime: Moment().format('YYYY-MM-DD HH:mm:ss') }; } diff --git a/utils/package.json b/utils/package.json index bab5997..8a3c8e3 100644 --- a/utils/package.json +++ b/utils/package.json @@ -1,6 +1,6 @@ { "name": "@ehason/utils", - "version": "1.1.0", + "version": "1.1.2", "description": "Utils for ehason develope", "main": "index.js", "scripts": { @@ -9,6 +9,7 @@ "author": "likeagle ", "license": "MIT", "dependencies": { - "amqplib": "^0.5.5" + "amqplib": "^0.5.5", + "moment": "^2.24.0" } }