Unverified 提交 f361ae43 authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw 提交者: GitHub

Merge pull request #2341 from dataease/pr@dev@fix_update_personinfo

fix: 修改个人信息报错
...@@ -26,6 +26,7 @@ import io.swagger.annotations.ApiImplicitParam; ...@@ -26,6 +26,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles; import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -148,7 +149,7 @@ public class SysUserController { ...@@ -148,7 +149,7 @@ public class SysUserController {
DataEaseException.throwException(Translator.get("i18n_wrong_content")); DataEaseException.throwException(Translator.get("i18n_wrong_content"));
} }
// 再次验证,匹配格式 // 再次验证,匹配格式
if (!request.getPhone().isEmpty() && !request.getPhone().matches("^1[3|4|5|7|8][0-9]{9}$")) { if (StringUtils.isNotBlank(request.getPhone()) && !request.getPhone().matches("^1[3|4|5|7|8][0-9]{9}$")) {
DataEaseException.throwException(Translator.get("i18n_wrong_tel")); DataEaseException.throwException(Translator.get("i18n_wrong_tel"));
} }
if (!request.getEmail().matches("^[a-zA-Z0-9_._-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$")) { if (!request.getEmail().matches("^[a-zA-Z0-9_._-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$")) {
......
...@@ -219,6 +219,8 @@ public class SysUserService { ...@@ -219,6 +219,8 @@ public class SysUserService {
@CacheEvict(value = AuthConstants.USER_CACHE_NAME, key = "'user' + #request.userId") @CacheEvict(value = AuthConstants.USER_CACHE_NAME, key = "'user' + #request.userId")
@Transactional @Transactional
public int updatePersonBasicInfo(SysUserCreateRequest request) { public int updatePersonBasicInfo(SysUserCreateRequest request) {
checkEmail(request);
checkNickName(request);
SysUser user = new SysUser(); SysUser user = new SysUser();
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
user.setUserId(request.getUserId()); user.setUserId(request.getUserId());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论