mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
适配 hydro-dev/geoip
This commit is contained in:
1 parent
8051bb958b
commit
c52ddd7512
3 files changed
+8
-2
No files matched your search
@@ -125,7 +125,12 @@ class HomeSecurityHandler extends Handler {
|
||||
session.isCurrent = session._id === this.session._id;
|
||||
session._id = md5(session._id);
|
||||
if (useragent) session.updateUa = useragent.parse(session.updateUa || session.createUa || '');
|
||||
if (geoip) session.updateGeoip = geoip.lookup(session.updateIp || session.createIp);
|
||||
if (geoip) {
|
||||
session.updateGeoip = geoip.lookup(
|
||||
session.updateIp || session.createIp,
|
||||
this.translate('geoip_locale'),
|
||||
);
|
||||
}
|
||||
}
|
||||
this.response.template = 'home_security.html';
|
||||
this.response.body = { sessions, geoipProvider: (geoip || {}).provider };
|
||||
|
||||
Reference in new issue
Block a user