|
|
|
@ -205,11 +205,13 @@ public class AppEnterpriseLoginServiceImpl implements IAppEnterpriseLoginService |
|
|
|
* @return 是否操作成功 |
|
|
|
*/ |
|
|
|
private EnterpriseUser saveOrUpdateEnterpriseUser(JSONObject userInfo) { |
|
|
|
String loginName = userInfo.getString("account"); |
|
|
|
String phone = IdCardCryptoUtil.symmetricDecryptIdCard(secretKey, userInfo.getString("phone")); |
|
|
|
String account = userInfo.getString("account"); |
|
|
|
String loginName = StringUtils.isNotEmpty(account) ? account : phone; |
|
|
|
String userType = UserType.APP_USER.getUserType(); |
|
|
|
EnterpriseUser newUser = null; |
|
|
|
if (StringUtils.isEmpty(loginName)) { |
|
|
|
log.error("深i企用户账号为空"); |
|
|
|
log.error("深i企用户账号和手机号均为空"); |
|
|
|
throw new BaseException("深i企用户账号不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
@ -244,10 +246,12 @@ public class AppEnterpriseLoginServiceImpl implements IAppEnterpriseLoginService |
|
|
|
private EnterpriseUser buildEnterpriseUser(JSONObject userInfo, String userType) { |
|
|
|
EnterpriseUser user = new EnterpriseUser(); |
|
|
|
String phone = IdCardCryptoUtil.symmetricDecryptIdCard(secretKey, userInfo.getString("phone")); |
|
|
|
String account = userInfo.getString("account"); |
|
|
|
String loginName = StringUtils.isNotEmpty(account) ? account : phone; |
|
|
|
// 基本信息
|
|
|
|
user.setUserName(userInfo.getString("userName")); |
|
|
|
user.setUserType(userType); |
|
|
|
user.setLoginName(userInfo.getString("account")); |
|
|
|
user.setLoginName(loginName); |
|
|
|
user.setPhonenumber(phone); |
|
|
|
user.setNickName(userInfo.getString("userName")); |
|
|
|
|
|
|
|
|