三江统一登录代码修改

This commit is contained in:
Administrator 2023-03-30 18:03:44 +08:00
parent 8beac86ac9
commit 68ba5df7ea
3 changed files with 15 additions and 3 deletions

View File

@ -31,7 +31,7 @@ public class UopModifyMessageReceiveListener {
@PostConstruct
public void start() {
if (profileJudgeUtil.isSjjtGsxDev()) {
if (profileJudgeUtil.isSjjt()) {
if (receiver != null) {
receiver.stop();
}
@ -50,7 +50,7 @@ public class UopModifyMessageReceiveListener {
@PreDestroy
public void end() {
if (profileJudgeUtil.isSjjtGsxDev()) {
if (profileJudgeUtil.isSjjt()) {
receiver.stop();
log.info("关闭mq");
}

View File

@ -66,7 +66,7 @@ public class JwtTokenFilter extends OncePerRequestFilter {
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
if (securityEnable) {
//三江统一认证3.登录过滤器判断回调地址获取code调用获取令牌首页根据令牌获取登录数据信息
if (profileJudgeUtil.isSjjtGsxDev()) {
if (profileJudgeUtil.isSjjt()) {
try {
validateSjProfile(request, response, filterChain);
} catch (InvalidKeySpecException e) {

View File

@ -3,6 +3,9 @@ package com.zhgd.xmgl.util;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.stream.Stream;
/**
* 环境判断
*/
@ -29,6 +32,15 @@ public class ProfileJudgeUtil {
return "sjjt-gsx".equals(activeProfile);
}
/**
* 是否三江环境包括本地测试生产
*
* @return
*/
public boolean isSjjt() {
return Stream.of("sjjt-gsx", "sjjt-prod").anyMatch(s -> s.equals(activeProfile));
}
/**
* 是否中建四局生产环境
*