提交 792a8666 authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

fix: 修改个人信息报错

上级 9572a0fb
......@@ -26,6 +26,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;
......@@ -148,7 +149,7 @@ public class SysUserController {
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"));
}
if (!request.getEmail().matches("^[a-zA-Z0-9_._-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$")) {
......
......@@ -219,6 +219,8 @@ public class SysUserService {
@CacheEvict(value = AuthConstants.USER_CACHE_NAME, key = "'user' + #request.userId")
@Transactional
public int updatePersonBasicInfo(SysUserCreateRequest request) {
checkEmail(request);
checkNickName(request);
SysUser user = new SysUser();
long now = System.currentTimeMillis();
user.setUserId(request.getUserId());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论