fix(web): 修复开启 i18n 后访问接口报错的问题

This commit is contained in:
2025-02-20 20:36:55 +08:00
parent 18b7ee6dfe
commit 0d7f777fd5
3 changed files with 41 additions and 31 deletions

View File

@@ -21,14 +21,13 @@ import org.apache.commons.lang3.reflect.TypeUtils;
import org.springdoc.core.parsers.ReturnTypeParser;
import org.springframework.core.MethodParameter;
import top.continew.starter.apidoc.util.DocUtils;
import top.continew.starter.web.model.R;
import java.lang.reflect.Type;
/**
* SpringDoc 全局响应处理器
* <p>
* 接口文档全局添加响应格式 {@link R}
* 接口文档全局添加响应格式 {@link com.feiniaojin.gracefulresponse.data.Response}
* </p>
*
* @author echo

View File

@@ -183,7 +183,7 @@ public class GlobalResponseAutoConfiguration {
@ConditionalOnProperty(prefix = PropertiesConstants.WEB_RESPONSE, name = "i18n", havingValue = "true")
public MessageSource messageSource() {
ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
messageSource.setBasenames("i18n", "i18n/empty-messages");
messageSource.setBasenames("i18n", "i18n/messages");
messageSource.setDefaultEncoding("UTF-8");
messageSource.setDefaultLocale(Locale.CHINA);
return messageSource;