fix mobile ua

This commit is contained in:
devezhao 2021-06-10 14:03:56 +08:00
parent 0355840993
commit fc7718cf4d
2 changed files with 8 additions and 12 deletions

View file

@ -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);

View file

@ -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);