|
@@ -138,14 +138,18 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
if (username.length() > 32) {
|
|
if (username.length() > 32) {
|
|
return HttpStatusEnum.USERNAME_TOO_LONG;
|
|
return HttpStatusEnum.USERNAME_TOO_LONG;
|
|
}
|
|
}
|
|
- //合规验证
|
|
|
|
- if (username.matches("/\\s/") || username.matches("/^ZN/i") || !username.matches("/^[a-zA-Z0-9]+$/i")) {
|
|
|
|
- return HttpStatusEnum.USERNAME_BAD_CHAR;
|
|
|
|
- }
|
|
|
|
- //用户名不是手机号, 用户名只能是数字和字母
|
|
|
|
- if (!StringUtils.checkPhone(username) && !username.matches("/^(?![^a-zA-Z]+$).{4,32}$/")) {
|
|
|
|
- return HttpStatusEnum.USERNAME_BAD_CHAR;
|
|
|
|
- }
|
|
|
|
|
|
+// boolean matches = username.matches("[\\s]");
|
|
|
|
+// if (!username.matches("/^[a-zA-Z0-9]+$/i")){
|
|
|
|
+// return HttpStatusEnum.USERNAME_BAD_CHAR;
|
|
|
|
+// }
|
|
|
|
+// //合规验证
|
|
|
|
+// if (username.matches("/\\s/") || username.matches("/^ZN/i") || !username.matches("^[a-zA-Z0-9]+$")) {
|
|
|
|
+// return HttpStatusEnum.USERNAME_BAD_CHAR;
|
|
|
|
+// }
|
|
|
|
+// //用户名不是手机号, 用户名只能是数字和字母
|
|
|
|
+// if (!StringUtils.checkPhone(username) && !username.matches("/^(?![^a-zA-Z]+$).{4,32}$/")) {
|
|
|
|
+// return HttpStatusEnum.USERNAME_BAD_CHAR;
|
|
|
|
+// }
|
|
//判断用户名是否存在敏感词
|
|
//判断用户名是否存在敏感词
|
|
if (wordCheckService.hasWord(username)) {
|
|
if (wordCheckService.hasWord(username)) {
|
|
return HttpStatusEnum.USERNAME_SENSITIVE;
|
|
return HttpStatusEnum.USERNAME_SENSITIVE;
|
|
@@ -174,9 +178,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
if (password.length() > 32) {
|
|
if (password.length() > 32) {
|
|
return HttpStatusEnum.PASSWORD_TOO_LONG;
|
|
return HttpStatusEnum.PASSWORD_TOO_LONG;
|
|
}
|
|
}
|
|
- if (password.matches("/\\s/") || !password.matches("A([a-zA-Z0-9~`#$%^&*!@.,()\\\\{}|:;?<>]){6,32}$")) {
|
|
|
|
- return HttpStatusEnum.PASSWORD_BAD_CHAR;
|
|
|
|
- }
|
|
|
|
|
|
+// if (password.matches("/\\s/") || !password.matches("A([a-zA-Z0-9~`#$%^&*!@.,()\\\\{}|:;?<>]){6,32}$")) {
|
|
|
|
+// return HttpStatusEnum.PASSWORD_BAD_CHAR;
|
|
|
|
+// }
|
|
return HttpStatusEnum.SUCCESS;
|
|
return HttpStatusEnum.SUCCESS;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -293,14 +297,16 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
- public ResultVo updatePassword(UpdatePasswordParam updatePasswordParam) {
|
|
|
|
|
|
+ public ResultVo<Boolean> updatePassword(UpdatePasswordParam updatePasswordParam) {
|
|
String mobile = updatePasswordParam.getMobile();
|
|
String mobile = updatePasswordParam.getMobile();
|
|
Integer type = updatePasswordParam.getType();
|
|
Integer type = updatePasswordParam.getType();
|
|
String code = updatePasswordParam.getCode();
|
|
String code = updatePasswordParam.getCode();
|
|
String username = updatePasswordParam.getUsername();
|
|
String username = updatePasswordParam.getUsername();
|
|
String password = updatePasswordParam.getPassword();
|
|
String password = updatePasswordParam.getPassword();
|
|
//根据用户名查询用户信息
|
|
//根据用户名查询用户信息
|
|
- User user = super.getOne(new LambdaQueryWrapper<User>().eq(User::getUsername, username));
|
|
|
|
|
|
+ User user = super.getOne(new LambdaQueryWrapper<User>()
|
|
|
|
+ .eq(User::getUsername, username)
|
|
|
|
+ .eq(User::getMobile, mobile));
|
|
if (user == null) {
|
|
if (user == null) {
|
|
return new ResultVo<>(HttpStatusEnum.USERNAME_NOT_EXISTS);
|
|
return new ResultVo<>(HttpStatusEnum.USERNAME_NOT_EXISTS);
|
|
}
|
|
}
|
|
@@ -320,7 +326,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
.set(User::getUpdateTime, LocalDateTime.now())
|
|
.set(User::getUpdateTime, LocalDateTime.now())
|
|
.eq(User::getId, user.getId()));
|
|
.eq(User::getId, user.getId()));
|
|
//返回修改成功
|
|
//返回修改成功
|
|
- return new ResultVo(HttpStatusEnum.SUCCESS);
|
|
|
|
|
|
+ return new ResultVo<>(HttpStatusEnum.SUCCESS, Boolean.TRUE);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|