mirror of
https://gitee.com/dromara/MaxKey.git
synced 2026-05-15 04:52:09 +08:00
IpRegion IP地址转换为行政区域
Ip138 ,Ip360 ,Ipchaxun ,Ipcn ,Pconline & Local
This commit is contained in:
@@ -228,6 +228,10 @@ public class RealmAuthenticationProvider extends AbstractAuthenticationProvider
|
||||
WebContext.setAuthentication(authenticationToken);
|
||||
|
||||
WebContext.setAttribute(WebConstants.CURRENT_USER_SESSION_ID, currentUserSessionId);
|
||||
|
||||
if(!WebContext.getInst(WebContext.getRequest()).equalsIgnoreCase(userInfo.getInstId())){
|
||||
//TODO :
|
||||
}
|
||||
return authenticationToken;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.maxkey.persistence.service.UserInfoService;
|
||||
import org.maxkey.util.DateUtils;
|
||||
import org.maxkey.web.WebConstants;
|
||||
import org.maxkey.web.WebContext;
|
||||
import org.maxkey.web.ipregion.IpRegionFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
@@ -49,8 +50,6 @@ public abstract class AbstractAuthenticationRealm {
|
||||
|
||||
protected JdbcTemplate jdbcTemplate;
|
||||
|
||||
protected boolean provisioning;
|
||||
|
||||
protected PasswordPolicyValidator passwordPolicyValidator;
|
||||
|
||||
protected LoginRepository loginRepository;
|
||||
@@ -136,7 +135,7 @@ public abstract class AbstractAuthenticationRealm {
|
||||
HistoryLogin historyLogin = new HistoryLogin();
|
||||
historyLogin.setSessionId(WebContext.genId());
|
||||
historyLogin.setSessionStatus(7);
|
||||
if(WebContext.getAttribute(WebConstants.CURRENT_USER_SESSION_ID) !=null) {
|
||||
if(WebContext.getAttribute(WebConstants.CURRENT_USER_SESSION_ID) != null) {
|
||||
historyLogin.setSessionStatus(1);
|
||||
historyLogin.setSessionId(WebContext.getAttribute(WebConstants.CURRENT_USER_SESSION_ID).toString());
|
||||
}
|
||||
@@ -150,6 +149,8 @@ public abstract class AbstractAuthenticationRealm {
|
||||
historyLogin.setBrowser(browser.getName());
|
||||
historyLogin.setPlatform(browser.getPlatform());
|
||||
historyLogin.setSourceIp(userInfo.getLastLoginIp());
|
||||
historyLogin.setIpRegion(IpRegionFactory.getFactory().region(userInfo.getLastLoginIp()));
|
||||
historyLogin.setIpLocation(IpRegionFactory.getFactory().getLocation(historyLogin.getIpRegion()));
|
||||
historyLogin.setProvider(provider);
|
||||
historyLogin.setCode(code);
|
||||
historyLogin.setLoginType(type);
|
||||
|
||||
Reference in New Issue
Block a user