Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何知道用户是通过手机还是 PC 登录到我的应用程序?我们如何跟踪他?Java 中有什么机制可以找出正在使用哪个设备登录?
可以使用简单的 JNSI 来获取它,例如。
private native String getUserAgent() /*-{ return navigator.userAgent.toLowerCase(); }-*/;
我使用java代码来获取userAgent:
private String UserAgent = Navigator.getUserAgent()