多时区支持

This commit is contained in:
masnn committed 2020-06-11 13:23:21 +08:00
1 parent d14b63883e
commit 8c20c34d8b
9 files changed
+163 -104

No files matched your search

+6 -2
View File
@@ -306,8 +306,12 @@ function Route(route, RouteHandler, permission = null) {
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] || 'system';
try {
args.domainId = (h.request.url.split('//')[1] || '')
.split(`.${await system.get('server.host')}`)[0] || 'system';
} catch (e) {
// Ignore
}
}
if (h.___prepare) await h.___prepare(args);