Skip to content

Commit

Permalink
update init password
Browse files Browse the repository at this point in the history
  • Loading branch information
woodwhales committed Jun 23, 2024
1 parent 550adff commit ffd8999
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@ public void init() {
if(StringUtils.isBlank(password)) {
password = "admin";
}
String encodePassword = passwordEncoder.encode(password);
if(Objects.isNull(sysUser)) {
sysUser = new SysUser();
sysUser.setUsername("admin");
sysUser.setPassword(passwordEncoder.encode(password));
sysUser.setPassword(encodePassword);
sysUser.setTwoFactorSecret("");
sysUser.setTwoFactorEnabled(false);
this.saveOrUpdate(sysUser);
} else {
this.update(Wrappers.<SysUser>lambdaUpdate()
.eq(SysUser::getId, sysUser.getId())
.set(SysUser::getPassword, passwordEncoder.encode(password)));
.set(SysUser::getPassword, encodePassword));
}
}

Expand Down

0 comments on commit ffd8999

Please sign in to comment.