Commit bb0b8bc6 authored by 孙傲's avatar 孙傲

关键词调整 timestamp -> t

parent 026fc1fb
{ {
"name": "nodejs-yitong-sdk", "name": "nodejs-yitong-sdk",
"version": "1.0.2", "version": "1.0.3",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
......
...@@ -375,9 +375,10 @@ function auth(opts) { ...@@ -375,9 +375,10 @@ function auth(opts) {
function track(opts) { function track(opts) {
return async function (ctx, next) { return async function (ctx, next) {
ctx.track = true; // 全部接口收集 ctx.track = true; // 全部接口收集
let t = Date.now();
ctx.trackEvent = { ctx.trackEvent = {
__referer__: `${opts.serviceName}:${ctx.path}`, __referer__: `${opts.serviceName}:${ctx.path}`,
timestamp: Date.now(), t: t,
app_key: ctx.getAppKey() || _.get(ctx.token, 'aud') || opts.appKey, app_key: ctx.getAppKey() || _.get(ctx.token, 'aud') || opts.appKey,
event: { event: {
key: 'api' key: 'api'
...@@ -388,7 +389,6 @@ function track(opts) { ...@@ -388,7 +389,6 @@ function track(opts) {
user_id: _.get(ctx.token, 'sub') user_id: _.get(ctx.token, 'sub')
} }
} }
let t = Date.now();
try { try {
await next(); await next();
} finally { } 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