Bladeren bron

fix 修复 WebMvc自动配置 优先于 国际化配置 Bean覆盖问题

疯狂的狮子Li 4 jaren geleden
bovenliggende
commit
6612a8b5e0

+ 3 - 0
ruoyi-common/ruoyi-common-web/src/main/java/com/ruoyi/common/web/config/I18nConfig.java

@@ -1,6 +1,8 @@
 package com.ruoyi.common.web.config;
 
 import com.ruoyi.common.web.core.I18nLocaleResolver;
+import org.springframework.boot.autoconfigure.AutoConfigureBefore;
+import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.LocaleResolver;
@@ -11,6 +13,7 @@ import org.springframework.web.servlet.LocaleResolver;
  * @author Lion Li
  */
 @Configuration
+@AutoConfigureBefore(WebMvcAutoConfiguration.class)
 public class I18nConfig {
 
     @Bean