提交 ba71042a authored 作者: 133's avatar 133

[用户] 添加密码重制接口

上级 0a9d5d45
...@@ -226,4 +226,11 @@ public class UserController { ...@@ -226,4 +226,11 @@ public class UserController {
return ResponseEntity.ok(userService.findAllLastUserids(securityUser.getCurrentUserInfo().getUserId())); return ResponseEntity.ok(userService.findAllLastUserids(securityUser.getCurrentUserInfo().getUserId()));
} }
@GetMapping("/up/date")
@ApiOperation(value = "重新设置密码", notes = "重新设置密码")
public ResponseEntity date() {
userService.updateUserPass();
return ResponseEntity.ok("ok");
}
} }
...@@ -139,4 +139,10 @@ public interface UserService extends PublicService<User> { ...@@ -139,4 +139,10 @@ public interface UserService extends PublicService<User> {
List<Integer> findAllLastUserids(Integer userId); List<Integer> findAllLastUserids(Integer userId);
/**
* 重制用户的密码
*/
void updateUserPass();
} }
...@@ -395,6 +395,19 @@ public class UserServiceImpl implements UserService { ...@@ -395,6 +395,19 @@ public class UserServiceImpl implements UserService {
return to(new ArrayList<>(),area); return to(new ArrayList<>(),area);
} }
@Override
public void updateUserPass() {
String encode = bCryptPasswordEncoder.encode("qwer1234");
List<User> users= userDao.findAll();
users.forEach(
user -> {
user.setPassword(encode);
user.setNoPassword("qwer1234");
}
);
userDao.saveAll(users);
}
private List<Integer> to(List<Integer> ids,Area area){ private List<Integer> to(List<Integer> ids,Area area){
if (area.getFatherId()==null){ if (area.getFatherId()==null){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论