From 3e7dc7da8d99646192588a6ec0e02bebafb37605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=B8=85?= <62982788+597365581@users.noreply.github.com> Date: Thu, 4 Jun 2020 16:26:26 +0800 Subject: [PATCH] merge method updateuser if and fix bug#2892 fix [BUG] When editing user information, clear the phone number, the database table t_ds_user.phone is not cleared #2892 --- .../dolphinscheduler/api/service/UsersService.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UsersService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UsersService.java index 815dcb0998..8d79c8e47c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UsersService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UsersService.java @@ -306,13 +306,11 @@ public class UsersService extends BaseService { user.setEmail(email); } - if (StringUtils.isNotEmpty(phone)) { - if (!CheckUtils.checkPhone(phone)){ - putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR,phone); - return result; - } - user.setPhone(phone); + if (StringUtils.isNotEmpty(phone) && !CheckUtils.checkPhone(phone)) { + putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR,phone); + return result; } + user.setPhone(phone); user.setQueue(queue); Date now = new Date(); user.setUpdateTime(now);