优化rating计算速度

This commit is contained in:
masnn committed 2020-06-09 13:22:04 +08:00
1 parent 45f1184d68
commit 55912b087d
22 files changed
+309 -178

No files matched your search

+2 -2
View File
@@ -302,7 +302,7 @@ function Route(route, RouteHandler, permission = null) {
const method = ctx.method.toLowerCase();
// TODO(masnn) domainId
const args = {
...ctx.params, ...ctx.query, ...ctx.request.body, domainId: 'system',
domainId: 'system', ...ctx.params, ...ctx.query, ...ctx.request.body,
};
if (h.request.host !== await system.get('server.host')) {
args.domainId = h.request.url.split('//')[1].split(`.${await system.get('server.host')}`)[0] || '';
@@ -399,7 +399,7 @@ function Connection(prefix, RouteConnHandler) {
sock.on('connection', async (conn) => {
const h = new RouteConnHandler(conn);
try {
const args = { ...h.request.params, domainId: 'system' };
const args = { domainId: 'system', ...h.request.params };
if (args.uid) args.uid = parseInt(validator.checkUid(args.uid));
if (args.page) args.page = parseInt(args.page);