|
@@ -30,6 +30,7 @@ import com.ym.mec.common.page.QueryInfo;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -144,6 +145,8 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
user.setOrganId(studentPreRegistration.getOrganId());
|
|
|
user.setRealName(studentPreRegistration.getParentName());
|
|
|
user.setUsername(studentPreRegistration.getUserName());
|
|
|
+ int phoneStrLen = user.getPhone().length();
|
|
|
+ user.setPassword(new BCryptPasswordEncoder().encode("gym" + user.getPhone().substring(phoneStrLen - 4, phoneStrLen)));
|
|
|
user.setUserType("STUDENT");
|
|
|
user.setCreateTime(date);
|
|
|
user.setUpdateTime(date);
|
|
@@ -1293,6 +1296,8 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
if (user == null || user.getId() == null) {
|
|
|
user = new SysUser();
|
|
|
BeanUtils.copyProperties(baseStudent,user);
|
|
|
+ int phoneStrLen = user.getPhone().length();
|
|
|
+ user.setPassword(new BCryptPasswordEncoder().encode("gym" + user.getPhone().substring(phoneStrLen - 4, phoneStrLen)));
|
|
|
user.setUsername(baseStudent.getUserName());
|
|
|
user.setUserType("STUDENT");
|
|
|
// 注册账户信息
|