mirror of
https://github.com/getrebuild/rebuild.git
synced 2024-11-10 17:04:33 +08:00
fix mobile ua
This commit is contained in:
parent
0355840993
commit
fc7718cf4d
2 changed files with 8 additions and 12 deletions
|
@ -65,7 +65,7 @@ public class ConfigurationController extends BaseController {
|
|||
// Available langs
|
||||
mv.getModel().put("availableLangs", JSON.toJSON(Application.getLanguage().availableLocales()));
|
||||
|
||||
JSONObject auth = License.queryAuthority(false);
|
||||
JSONObject auth = License.queryAuthority(true);
|
||||
mv.getModel().put("LicenseType",
|
||||
auth.getString("authType") + " (" + auth.getString("authObject") + ")");
|
||||
mv.getModel().put("Version", Application.VER);
|
||||
|
|
|
@ -232,17 +232,13 @@ public class LoginController extends BaseController {
|
|||
protected void createLoginLog(HttpServletRequest request, ID user) {
|
||||
String ipAddr = ServletUtils.getRemoteAddr(request);
|
||||
String UA = request.getHeader("user-agent");
|
||||
if (AppUtils.isRbMobile(request)) {
|
||||
UA = UA.toUpperCase();
|
||||
} else {
|
||||
UserAgent uas = UserAgent.parseUserAgentString(UA);
|
||||
try {
|
||||
UA = String.format("%s-%s (%s)",
|
||||
uas.getBrowser(), uas.getBrowserVersion().getMajorVersion(), uas.getOperatingSystem());
|
||||
} catch (Exception ex) {
|
||||
log.warn("Unknown user-agent : " + UA);
|
||||
UA = "UNKNOW";
|
||||
}
|
||||
UserAgent uas = UserAgent.parseUserAgentString(UA);
|
||||
try {
|
||||
UA = String.format("%s-%s (%s)",
|
||||
uas.getBrowser(), uas.getBrowserVersion().getMajorVersion(), uas.getOperatingSystem());
|
||||
} catch (Exception ex) {
|
||||
log.warn("Unknown user-agent : " + UA);
|
||||
UA = "UNKNOW";
|
||||
}
|
||||
|
||||
Record record = EntityHelper.forNew(EntityHelper.LoginLog, UserService.SYSTEM_USER);
|
||||
|
|
Loading…
Reference in a new issue