File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
src/main/java/com/github/codingdebugallday/client Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -22,4 +22,9 @@ public class NodeSettingInfo {
22
22
private String host ;
23
23
private String username ;
24
24
private String password ;
25
+ /**
26
+ * 是否需要修改该节点的密码
27
+ */
28
+ @ Builder .Default
29
+ private Boolean changePassword = false ;
25
30
}
Original file line number Diff line number Diff line change @@ -213,7 +213,11 @@ private List<Node> genNodeList(ClusterDTO clusterDTO) {
213
213
nodeDTO .setClusterCode (clusterDTO .getClusterCode ());
214
214
nodeDTO .setTenantId (clusterDTO .getTenantId ());
215
215
NodeSettingInfo nodeSettingInfo = JSON .toObj (nodeDTO .getSettingInfo (), NodeSettingInfo .class );
216
- nodeSettingInfo .setPassword (jasyptStringEncryptor .encrypt (nodeSettingInfo .getPassword ()));
216
+ // 第一次新增时对密码进行加密 或者 该节点需要对密码进行更新
217
+ if (Objects .isNull (nodeDTO .getNodeId ()) ||
218
+ nodeSettingInfo .getChangePassword ()) {
219
+ nodeSettingInfo .setPassword (jasyptStringEncryptor .encrypt (nodeSettingInfo .getPassword ()));
220
+ }
217
221
nodeDTO .setSettingInfo (JSON .toJson (nodeSettingInfo ));
218
222
return NodeConvertMapper .INSTANCE .dtoToEntity (nodeDTO );
219
223
}).collect (Collectors .toList ());
You can’t perform that action at this time.
0 commit comments