Commit bb0b8bc6 authored by 孙傲's avatar 孙傲

关键词调整 timestamp -> t

parent 026fc1fb
{
"name": "nodejs-yitong-sdk",
"version": "1.0.2",
"version": "1.0.3",
"description": "",
"main": "index.js",
"scripts": {
......
......@@ -375,9 +375,10 @@ function auth(opts) {
function track(opts) {
return async function (ctx, next) {
ctx.track = true; // 全部接口收集
let t = Date.now();
ctx.trackEvent = {
__referer__: `${opts.serviceName}:${ctx.path}`,
timestamp: Date.now(),
t: t,
app_key: ctx.getAppKey() || _.get(ctx.token, 'aud') || opts.appKey,
event: {
key: 'api'
......@@ -388,7 +389,6 @@ function track(opts) {
user_id: _.get(ctx.token, 'sub')
}
}
let t = Date.now();
try {
await next();
} finally {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment