Skip to content

Commit

Permalink
chore(alpha): update skyMode add getUin
Browse files Browse the repository at this point in the history
  • Loading branch information
huangyoukun committed Jun 13, 2018
1 parent 07c1803 commit 8fa5f8e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/tsw/util/auto-report/alpha.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ this.getUin = function(req) {
return uin;
}

// 业务有可能不使用uin登录态,支持业务扩展getUid实现
if (config.extendMod && typeof config.extendMod.getUid === 'function') {
return config.extendMod.getUid(req);
}

// 业务有可能不使用uin登录态,支持业务扩展getUin实现
if (config.extendMod && typeof config.extendMod.getUin === 'function') {
return config.extendMod.getUin(req);
Expand Down
7 changes: 7 additions & 0 deletions examples/skyMode/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ this.logger = {
};

this.memcached = { host: '127.0.0.1:11211', timeout: 500, poolSize: 20, retries: 1, maxQueueSize: 1000 };

this.extendMod = {
getUid: req => {
// http://127.0.0.1/log/view/xxx?uid=xxx
return req.GET.uid;
}
};

0 comments on commit 8fa5f8e

Please sign in to comment.