fix(ecom-dmb): 用户状态判断从!=0修正为!=1,与数据库设计(1-正常/0-禁用)保持一致

This commit is contained in:
小蟑螂
2026-04-18 12:51:59 +08:00
parent 740c193483
commit 2e73584a36
2 changed files with 5 additions and 5 deletions
@@ -66,7 +66,7 @@ public class UserMenuServiceImpl implements UserMenuService {
}
// 检查用户状态
if (user.getStatus() != 0) {
if (user.getStatus() != 1) {
throw new RuntimeException("用户状态异常");
}
@@ -97,7 +97,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserPO> implements
user.setPassword(passwordEncoder.encode(registerDTO.getPassword()));
user.setRealName("用户" + System.currentTimeMillis()); // 默认用户名
user.setRole("user"); // 默认角色
user.setStatus(0); // 正常状态
user.setStatus(1); // 正常状态
user.setPwdSecurityLevel(0); // 初始密码安全级别
user.setPwdUpdateTime(LocalDateTime.now());
@@ -127,7 +127,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserPO> implements
}
// 检查用户状态
if (user.getStatus() != 0) {
if (user.getStatus() != 1) {
throw new BusinessException("用户状态异常,无法登录");
}
@@ -347,7 +347,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserPO> implements
}
// 检查用户状态
if (user.getStatus() != 0) {
if (user.getStatus() != 1) {
throw new BusinessException("用户状态异常,无法刷新令牌");
}
@@ -369,7 +369,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserPO> implements
}
// 检查目标用户状态
if (targetUser.getStatus() != 0) {
if (targetUser.getStatus() != 1) {
throw new BusinessException("目标用户状态异常,无法切换");
}