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