diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java index be54c2321..5f2d9ea24 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java @@ -1,7 +1,7 @@ package com.ruoyi.common.utils; import org.springframework.context.MessageSource; -import com.ruoyi.common.constant.Constants; +import org.springframework.context.i18n.LocaleContextHolder; import com.ruoyi.common.utils.spring.SpringUtils; /** @@ -21,6 +21,6 @@ public class MessageUtils public static String message(String code, Object... args) { MessageSource messageSource = SpringUtils.getBean(MessageSource.class); - return messageSource.getMessage(code, args, Constants.DEFAULT_LOCALE); + return messageSource.getMessage(code, args, LocaleContextHolder.getLocale()); } }