|
@@ -169,15 +169,17 @@ public class KeycloakUserController {
|
|
|
@PutMapping("/keycloak/users/attribute")
|
|
@PutMapping("/keycloak/users/attribute")
|
|
|
public Response updateUserAttribute(@RequestHeader String userId , @RequestBody UserRepresentation representation){
|
|
public Response updateUserAttribute(@RequestHeader String userId , @RequestBody UserRepresentation representation){
|
|
|
Map<String, List<String>> userAttribute = representation.getAttributes();
|
|
Map<String, List<String>> userAttribute = representation.getAttributes();
|
|
|
|
|
+ KeycloakUserCO userCO = new KeycloakUserCO();
|
|
|
if(userAttribute != null){
|
|
if(userAttribute != null){
|
|
|
- KeycloakUserCO userCO = new KeycloakUserCO();
|
|
|
|
|
- userCO.setEmail(representation.getEmail());
|
|
|
|
|
userCO.setPhone(userAttribute.get("phone"));
|
|
userCO.setPhone(userAttribute.get("phone"));
|
|
|
userCO.setWechat(userAttribute.get("wechat"));
|
|
userCO.setWechat(userAttribute.get("wechat"));
|
|
|
userCO.setWechatApplet(userAttribute.get("wechat-applet-openid"));
|
|
userCO.setWechatApplet(userAttribute.get("wechat-applet-openid"));
|
|
|
- userCO.setId(userId);
|
|
|
|
|
- userService.updateUserAttribute(userCO);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ if(representation.getEmail() != null){
|
|
|
|
|
+ userCO.setEmail(representation.getEmail());
|
|
|
|
|
+ }
|
|
|
|
|
+ userCO.setId(userId);
|
|
|
|
|
+ userService.updateUserAttribute(userCO);
|
|
|
return keycloakService.updateUser(userId, representation, Constant.RESET_ATTRIBUTE);
|
|
return keycloakService.updateUser(userId, representation, Constant.RESET_ATTRIBUTE);
|
|
|
}
|
|
}
|
|
|
|
|
|