|
@@ -21,13 +21,13 @@ import cn.com.qmth.examcloud.service.core.dto.UserInfo;
|
|
import cn.com.qmth.examcloud.service.core.entity.Org;
|
|
import cn.com.qmth.examcloud.service.core.entity.Org;
|
|
import cn.com.qmth.examcloud.service.core.entity.Student;
|
|
import cn.com.qmth.examcloud.service.core.entity.Student;
|
|
import cn.com.qmth.examcloud.service.core.entity.User;
|
|
import cn.com.qmth.examcloud.service.core.entity.User;
|
|
|
|
+import cn.com.qmth.examcloud.service.core.entity.UserRole;
|
|
import cn.com.qmth.examcloud.service.core.enums.LoginType;
|
|
import cn.com.qmth.examcloud.service.core.enums.LoginType;
|
|
import cn.com.qmth.examcloud.service.core.enums.UserScope;
|
|
import cn.com.qmth.examcloud.service.core.enums.UserScope;
|
|
import cn.com.qmth.examcloud.service.core.enums.UserType;
|
|
import cn.com.qmth.examcloud.service.core.enums.UserType;
|
|
import cn.com.qmth.examcloud.service.core.repo.OrgRepo;
|
|
import cn.com.qmth.examcloud.service.core.repo.OrgRepo;
|
|
import cn.com.qmth.examcloud.service.core.repo.StudentRepo;
|
|
import cn.com.qmth.examcloud.service.core.repo.StudentRepo;
|
|
import cn.com.qmth.examcloud.service.core.repo.UserRepo;
|
|
import cn.com.qmth.examcloud.service.core.repo.UserRepo;
|
|
-
|
|
|
|
import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
|
|
import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -131,6 +131,9 @@ public class StudentService {
|
|
password = student.getIdentityNumber().substring(student.getIdentityNumber().length() - 6, student.getIdentityNumber().length());
|
|
password = student.getIdentityNumber().substring(student.getIdentityNumber().length() - 6, student.getIdentityNumber().length());
|
|
}
|
|
}
|
|
user.setPassword(password);
|
|
user.setPassword(password);
|
|
|
|
+ List<UserRole> userRoles = new ArrayList<UserRole>();
|
|
|
|
+ userRoles.add(new UserRole("ecs_oe","STUDENT"));
|
|
|
|
+ user.setUserRoles(userRoles);
|
|
userRepo.save(user);
|
|
userRepo.save(user);
|
|
student.setUser(user);
|
|
student.setUser(user);
|
|
}
|
|
}
|