Skip to content

Commit 8fa5f8e

Browse files
committed
chore(alpha): update skyMode add getUin
1 parent 07c1803 commit 8fa5f8e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

bin/tsw/util/auto-report/alpha.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ this.getUin = function(req) {
7373
return uin;
7474
}
7575

76+
// 业务有可能不使用uin登录态,支持业务扩展getUid实现
77+
if (config.extendMod && typeof config.extendMod.getUid === 'function') {
78+
return config.extendMod.getUid(req);
79+
}
80+
7681
// 业务有可能不使用uin登录态,支持业务扩展getUin实现
7782
if (config.extendMod && typeof config.extendMod.getUin === 'function') {
7883
return config.extendMod.getUin(req);

examples/skyMode/config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ this.logger = {
1212
};
1313

1414
this.memcached = { host: '127.0.0.1:11211', timeout: 500, poolSize: 20, retries: 1, maxQueueSize: 1000 };
15+
16+
this.extendMod = {
17+
getUid: req => {
18+
// http://127.0.0.1/log/view/xxx?uid=xxx
19+
return req.GET.uid;
20+
}
21+
};

0 commit comments

Comments
 (0)