refactor: update password error messages for consistency across user authentication

This commit is contained in:
zhao
2025-09-01 12:20:23 +08:00
parent d333205fc4
commit c5c908b97b
5 changed files with 500 additions and 498 deletions

View File

@@ -109,17 +109,17 @@ public class UserLoginService {
return sessionUser;
} catch (ExcessiveAttemptsException e) {
throw new ExcessiveAttemptsException(Translator.get("excessive_attempts"));
throw new ExcessiveAttemptsException(Translator.get("password_is_incorrect"));
} catch (LockedAccountException e) {
throw new LockedAccountException(Translator.get("user_locked"));
throw new LockedAccountException(Translator.get("password_is_incorrect"));
} catch (DisabledAccountException e) {
throw new DisabledAccountException(Translator.get("user_has_been_disabled"));
throw new DisabledAccountException(Translator.get("password_is_incorrect"));
} catch (ExpiredCredentialsException e) {
throw new ExpiredCredentialsException(Translator.get("user_expires"));
throw new ExpiredCredentialsException(Translator.get("password_is_incorrect"));
} catch (AuthenticationException e) {
throw new AuthenticationException(e.getMessage());
} catch (UnauthorizedException e) {
throw new UnauthorizedException(Translator.get("not_authorized") + e.getMessage());
throw new UnauthorizedException(Translator.get("password_is_incorrect") + e.getMessage());
}
}
@@ -133,7 +133,7 @@ public class UserLoginService {
public UserDTO authenticateUser(String userKey) {
// 获取用户信息
UserDTO userDTO = Optional.ofNullable(extUserMapper.selectByPhoneOrEmail(userKey))
.orElseThrow(() -> new AuthenticationException(Translator.get("user_not_exist")));
.orElseThrow(() -> new AuthenticationException(Translator.get("password_is_incorrect")));
// 非管理员用户需要检查是否被禁用
if (!isAdminUser(userDTO.getId())) {
@@ -240,7 +240,7 @@ public class UserLoginService {
List<OrganizationUser> orgUsers = organizationUserMapper.selectListByLambda(queryWrapper);
if (CollectionUtils.isEmpty(orgUsers)) {
throw new DisabledAccountException(Translator.get("user_has_been_disabled"));
throw new DisabledAccountException(Translator.get("password_is_incorrect"));
}
// 设置用户部门信息

View File

@@ -244,10 +244,10 @@ message.high_seas_customer_distributed_text=Attention! ${name} has been assigned
message.customer_follow_up_plan_due_text=Attention! The follow-up plan you created for ${name} is due, please follow up promptly!
message.clue_automatic_move_pool_text=Attention! According to system rules, your lead ${name} has been moved to the lead pool!
message.clue_moved_pool_text=Attention! ${OPERATOR} has moved your lead ${name} to the lead pool, please be informed!
message.clue_convert_customer_text=AttentionYour lead ${name} has been converted to customerplease be informed!
message.clue_convert_business_text=AttentionYour lead ${name} has been converted to opportunityplease be informed!
message.customer.collaboration.add.text=Attention{operator} adds ${uName} as your collaborator responsible for customer {name}! please be informed!
message.customer.contact.add.text=Attention{operator} creates a {cName} contact for you, please be informed!
message.clue_convert_customer_text=Attention\uFF01Your lead ${name} has been converted to customer\uFF01please be informed!
message.clue_convert_business_text=Attention\uFF01Your lead ${name} has been converted to opportunity\uFF01please be informed!
message.customer.collaboration.add.text=Attention\uFF01{operator} adds ${uName} as your collaborator responsible for customer {name}! please be informed!
message.customer.contact.add.text=Attention\uFF01{operator} creates a {cName} contact for you, please be informed!
message.clue_relate_customer=Attention! Your lead ${name} is associated with customer {customerName}!
message.transfer_clue_text=Attention! ${OPERATOR} transferred lead ${name} to you, please be informed!
message.clue_deleted_text=Attention! Your lead ${name} has been deleted by ${OPERATOR}!
@@ -303,7 +303,7 @@ customer_capacity_not_exist=Customer capacity rule does not exist!
customer_rule_condition_error=Parsing failed, invalid recovery rule format!
customer.relation.target_customer.exist=Customer {0} already belongs to a group!
password_is_incorrect=Incorrect password
password_is_incorrect=Invalid username or password
department_comment=XX Company/XX Division/R&D Department
employee_type_comment=Employee type: Regular/Intern/Outsourcing
user_import_template_name=User import template

View File

@@ -3,6 +3,7 @@
cp -rf /opt/cordys/conf/mysql/my.cnf /etc/my.cnf.d/mariadb-server.cnf
mkdir -p /opt/cordys/data/mysql
mkdir -p /opt/cordys/conf/mysql
chmod -R 777 /opt/cordys
chmod 644 /etc/mysql/conf.d/my.cnf

View File

@@ -10,6 +10,7 @@ log() {
log "创建 Redis 数据目录..."
mkdir -p /opt/cordys/data/redis
mkdir -p /opt/cordys/conf/redis
chmod -R 777 /opt/cordys
# 检查 Redis 密码
if [ -z "${REDIS_PASSWORD}" ]; then