| | |
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.beans.factory.annotation.Value;
|
| | | import org.springframework.stereotype.Component;
|
| | | import com.ruoyi.common.constant.CacheConstants;
|
| | | import com.ruoyi.common.constant.Constants;
|
| | | import com.ruoyi.common.utils.ServletUtils;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | |
| | | public void setUserAgent(LoginUser loginUser)
|
| | | {
|
| | | UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
|
| | | String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
|
| | | String ip = IpUtils.getIpAddr();
|
| | | loginUser.setIpaddr(ip);
|
| | | loginUser.setLoginLocation(AddressUtils.getRealAddressByIP(ip));
|
| | | loginUser.setBrowser(userAgent.getBrowser().getName());
|
| | |
| | |
|
| | | private String getTokenKey(String uuid)
|
| | | {
|
| | | return Constants.LOGIN_TOKEN_KEY + uuid;
|
| | | return CacheConstants.LOGIN_TOKEN_KEY + uuid;
|
| | | }
|
| | | }
|