Browse Source

fix: 尝试修复创建git用户时密码不对的问题

刘一也 4 years ago
parent
commit
395a450c4a

+ 3 - 2
seecoder-portal-server/src/main/java/cn/seecoder/seecoderportalserver/service/UserService.java

@@ -37,12 +37,13 @@ public class UserService {
 
     public UserService(
             UserRepository userRepository, PasswordEncoder passwordEncoder,
-            UserMapper userMapper, AliService aliService, GitlabService gitlabService) {
+            UserMapper userMapper, AliService aliService, GitlabService gitlabService, SeecoderGitlabApi gitlabApi) {
         this.userRepository = userRepository;
         this.passwordEncoder = passwordEncoder;
         this.userMapper = userMapper;
         this.aliService = aliService;
         this.gitlabService = gitlabService;
+        this.gitlabApi = gitlabApi;
     }
 
     public List<User> findAllUsers() {
@@ -215,7 +216,7 @@ public class UserService {
         try {
             user.setPassword(userVO.getUsername());
             GitlabUserVO gitlabUserVO = generateGitlabUser(user);
-            gitlabApi.changePassword(gitlabUserVO.getUserId(), userVO.getUsername());
+            gitlabApi.changePassword(gitlabUserVO.getUserId(), "12345678" + userVO.getUsername());
         } catch (CustomErrorException customErrorException) {
             log.error("Yuantu register create gitlab user error");
             log.error(customErrorException.getMessage());