From 15f7d4dc471a735ead8000fc0809cd46c390f055 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期四, 22 十二月 2022 18:26:18 +0800
Subject: [PATCH] update 优化 springdoc 配置鉴权头写死问题 增加持久化鉴权头配置

---
 ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java |   46 ++++++++++++++++++++++------------------------
 1 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java
index 48b341b..e64fa3a 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java
@@ -1,7 +1,6 @@
 package com.ruoyi.framework.config;
 
 import cn.hutool.core.util.StrUtil;
-import org.jetbrains.annotations.NotNull;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.LocaleResolver;
@@ -18,31 +17,30 @@
 @Configuration
 public class I18nConfig {
 
-	@Bean
-	public LocaleResolver localeResolver() {
-		return new I18nLocaleResolver();
-	}
+    @Bean
+    public LocaleResolver localeResolver() {
+        return new I18nLocaleResolver();
+    }
 
-	/**
-	 * 鑾峰彇璇锋眰澶村浗闄呭寲淇℃伅
-	 */
-	static class I18nLocaleResolver implements LocaleResolver {
+    /**
+     * 鑾峰彇璇锋眰澶村浗闄呭寲淇℃伅
+     */
+    static class I18nLocaleResolver implements LocaleResolver {
 
-		@NotNull
-		@Override
-		public Locale resolveLocale(HttpServletRequest httpServletRequest) {
-			String language = httpServletRequest.getHeader("content-language");
-			Locale locale = Locale.getDefault();
-			if (StrUtil.isNotBlank(language)) {
-				String[] split = language.split("_");
-				locale = new Locale(split[0], split[1]);
-			}
-			return locale;
-		}
+        @Override
+        public Locale resolveLocale(HttpServletRequest httpServletRequest) {
+            String language = httpServletRequest.getHeader("content-language");
+            Locale locale = Locale.getDefault();
+            if (StrUtil.isNotBlank(language)) {
+                String[] split = language.split("_");
+                locale = new Locale(split[0], split[1]);
+            }
+            return locale;
+        }
 
-		@Override
-		public void setLocale(@NotNull HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Locale locale) {
+        @Override
+        public void setLocale(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Locale locale) {
 
-		}
-	}
+        }
+    }
 }

--
Gitblit v1.9.3