From b420562862a0cd3899490e87cdd48cc075bc8544 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期二, 05 十二月 2023 09:26:58 +0800
Subject: [PATCH] 清淤BUG修改
---
ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java
index c01f691..14874ba 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java
@@ -1,11 +1,16 @@
package com.ruoyi.framework.security.handle;
import java.io.IOException;
+import java.util.Locale;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.utils.MessageUtils;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
+import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
import com.alibaba.fastjson2.JSON;
@@ -23,6 +28,7 @@
*
* @author ruoyi
*/
+@Slf4j
@Configuration
public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler
{
@@ -45,7 +51,17 @@
// 鍒犻櫎鐢ㄦ埛缂撳瓨璁板綍
tokenService.delLoginUser(loginUser.getToken());
// 璁板綍鐢ㄦ埛閫�鍑烘棩蹇�
- AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "閫�鍑烘垚鍔�"));
+ //鍥介檯鍖�
+ final String key = "language";
+ String language = request.getHeader(key);
+ if (language == null) {
+ //String language = "en-US";
+ language = "en-US";
+ }
+ log.info("褰撳墠璇█={}", language);
+ Locale locale = new Locale(language.split("-")[0], language.split("-")[1]);
+ LocaleContextHolder.setLocale(locale);
+ AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT,MessageUtils.message("user.logout.success")));
}
ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.success("閫�鍑烘垚鍔�")));
}
--
Gitblit v1.9.3