bugfix-企业登录注册
This commit is contained in:
@@ -829,10 +829,10 @@ public class SysLoginService
|
||||
if (appUser != null) {
|
||||
// 用户存在
|
||||
if (StringUtils.isBlank(appUser.getYtjPassword())) {
|
||||
// 密码为空,设置密码并登录
|
||||
// 密码为空,设置密码并登录(注意:updateAppUser会自动加密密码)
|
||||
AppUser updateParam = new AppUser();
|
||||
updateParam.setUserId(appUser.getUserId());
|
||||
updateParam.setYtjPassword(SiteSecurityUtils.encryptPassword(password));
|
||||
updateParam.setYtjPassword(password); // 传明文,updateAppUser会加密
|
||||
updateParam.setLoginDate(new Date());
|
||||
// 如果传了企业信息,也更新
|
||||
if (StringUtils.isNotBlank(companyCode)) {
|
||||
@@ -842,7 +842,8 @@ public class SysLoginService
|
||||
updateParam.setName(companyName);
|
||||
}
|
||||
appUserService.updateAppUser(updateParam);
|
||||
appUser.setYtjPassword(updateParam.getYtjPassword());
|
||||
// 重新查询获取加密后的密码
|
||||
appUser = appUserService.getPhoneAndUserType(phone, StringUtil.IS_COMPANY_USER);
|
||||
} else {
|
||||
// 密码已设置,校验密码
|
||||
if (!SiteSecurityUtils.matchesPassword(password, appUser.getYtjPassword())) {
|
||||
|
||||
Reference in New Issue
Block a user