登录记录-增加ipRegion
This commit is contained in:
@@ -16,6 +16,7 @@ import com.accompany.core.service.account.AccountService;
|
||||
import com.accompany.core.service.account.LoginRecordService;
|
||||
import com.accompany.core.service.account.UserAppService;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import com.accompany.core.service.region.RegionService;
|
||||
import com.accompany.core.service.user.PhoneBlackService;
|
||||
import com.accompany.core.service.user.UsersBaseService;
|
||||
import com.accompany.oauth2.constant.LoginTypeEnum;
|
||||
@@ -66,6 +67,8 @@ public class MyUserDetailsServiceImpl implements MyUserDetailsService {
|
||||
private SysConfService sysConfService;
|
||||
@Autowired
|
||||
private PhoneBlackService phoneBlackService;
|
||||
@Autowired
|
||||
private RegionService regionService;
|
||||
|
||||
/**
|
||||
* 不允许登录的用户账号类型
|
||||
@@ -183,6 +186,7 @@ public class MyUserDetailsServiceImpl implements MyUserDetailsService {
|
||||
public AccountLoginRecord buildAccountLoginRecord(String ipAddress, Account account, byte loginType, DeviceInfo deviceInfo, String openId) {
|
||||
AccountLoginRecord accountLoginRecord = new AccountLoginRecord();
|
||||
accountLoginRecord.setLoginIp(ipAddress);
|
||||
accountLoginRecord.setLoginIpRegion(regionService.getRegion(ipAddress));
|
||||
accountLoginRecord.setUid(account.getUid());
|
||||
accountLoginRecord.setErbanNo(account.getErbanNo());
|
||||
accountLoginRecord.setLoginType(loginType);
|
||||
@@ -196,12 +200,6 @@ public class MyUserDetailsServiceImpl implements MyUserDetailsService {
|
||||
accountLoginRecord.setOsversion(deviceInfo.getOsVersion());
|
||||
accountLoginRecord.setCreateTime(new Date());
|
||||
|
||||
if (loginType == LoginTypeEnum.WECHAT.getValue()) {
|
||||
accountLoginRecord.setWeixinOpenid(openId);
|
||||
}
|
||||
if (loginType == LoginTypeEnum.QQ.getValue()) {
|
||||
accountLoginRecord.setQqOpenid(openId);
|
||||
}
|
||||
if (loginType == LoginTypeEnum.APPLE.getValue()) {
|
||||
accountLoginRecord.setAppleUid(openId);
|
||||
}
|
||||
|
Reference in New Issue
Block a user