Quellcode durchsuchen

Merge branch 'dev'

# Conflicts:
#	pigx-config/src/main/resources/config/pigx-auth-dev.yml
#	pigx-config/src/main/resources/config/pigx-codegen-dev.yml
#	pigx-config/src/main/resources/config/pigx-daemon-dev.yml
#	pigx-config/src/main/resources/config/pigx-upms-dev.yml
冷冷 vor 7 Jahren
Ursprung
Commit
82ba3ed08e
33 geänderte Dateien mit 699 neuen und 173 gelöschten Zeilen
  1. 2 1
      README.md
  2. 15 35
      doc/pigx.sql
  3. 2 2
      pigx-auth/src/main/java/com/pig4cloud/pigx/auth/PigxAuthApplication.java
  4. 2 0
      pigx-auth/src/main/java/com/pig4cloud/pigx/auth/config/WebSecurityConfigurer.java
  5. 181 0
      pigx-auth/src/main/java/com/pig4cloud/pigx/auth/endpoint/PigxTokenEndpoint.java
  6. 0 60
      pigx-auth/src/main/java/com/pig4cloud/pigx/auth/endpoint/RevokeTokenEndpoint.java
  7. 4 2
      pigx-common/pigx-common-core/pom.xml
  8. 17 23
      pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/config/JacksonConfig.java
  9. 0 15
      pigx-common/pigx-common-log/src/main/java/com/pig4cloud/pigx/common/log/util/SysLogUtils.java
  10. 87 0
      pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/PigxResourceServerTokenRelayAutoConfiguration.java
  11. 82 0
      pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/feign/EnablePigxFeignClients.java
  12. 1 0
      pigx-common/pigx-common-security/src/main/resources/META-INF/spring.factories
  13. 0 2
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/feign/TransactionRestTemplateInterceptor.java
  14. 1 1
      pigx-gateway/src/main/java/com/pig4cloud/pigx/gateway/config/RouterFunctionConfiguration.java
  15. 1 1
      pigx-gateway/src/main/java/com/pig4cloud/pigx/gateway/filter/PreviewGatewayFilter.java
  16. 2 2
      pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/RemoteLogService.java
  17. 54 0
      pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/RemoteTokenService.java
  18. 38 0
      pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/factory/RemoteLogServiceFallbackFactory.java
  19. 38 0
      pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/factory/RemoteTokenServiceFallbackFactory.java
  20. 4 1
      pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/fallback/RemoteLogServiceFallbackImpl.java
  21. 66 0
      pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/fallback/RemoteTokenServiceFallbackImpl.java
  22. 4 1
      pigx-upms/pigx-upms-api/src/main/resources/META-INF/spring.factories
  23. 2 2
      pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/PigxAdminApplication.java
  24. 63 0
      pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/TokenController.java
  25. 8 5
      pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysUserMapper.java
  26. 5 2
      pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysUserService.java
  27. 7 3
      pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysRoleMenuServiceImpl.java
  28. 1 1
      pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysUserServiceImpl.java
  29. 5 9
      pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/mapper/SysGeneratorMapper.java
  30. 3 2
      pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/service/impl/SysGeneratorServiceImpl.java
  31. 1 1
      pigx-visual/pigx-codegen/src/main/resources/template/Mapper.xml.vm
  32. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/compensate/service/impl/CompensateServiceImpl.java
  33. 2 1
      pom.xml

+ 2 - 1
README.md

@@ -20,7 +20,8 @@ https://pig4cloud.com
 
 ### 使用说明  
 
-[目录](doc/md/catalog.md)
+请参考VIP群共享 《从零开始部署pigx》
+[>> 目录](doc/md/catalog.md)
 
 ## 协议和授权
 

Datei-Diff unterdrückt, da er zu groß ist
+ 15 - 35
doc/pigx.sql


+ 2 - 2
pigx-auth/src/main/java/com/pig4cloud/pigx/auth/PigxAuthApplication.java

@@ -20,9 +20,9 @@
 package com.pig4cloud.pigx.auth;
 
 
+import com.pig4cloud.pigx.common.security.feign.EnablePigxFeignClients;
 import org.springframework.boot.SpringApplication;
 import org.springframework.cloud.client.SpringCloudApplication;
-import org.springframework.cloud.openfeign.EnableFeignClients;
 
 /**
  * @author lengleng
@@ -30,7 +30,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
  * 认证授权中心
  */
 @SpringCloudApplication
-@EnableFeignClients({"com.pig4cloud.pigx.admin.api.feign"})
+@EnablePigxFeignClients
 public class PigxAuthApplication {
 
 	public static void main(String[] args) {

+ 2 - 0
pigx-auth/src/main/java/com/pig4cloud/pigx/auth/config/WebSecurityConfigurer.java

@@ -64,6 +64,8 @@ public class WebSecurityConfigurer extends WebSecurityConfigurerAdapter {
 			.antMatchers(
 				"/actuator/**",
 				"/oauth/removeToken",
+				"/oauth/delToken/*",
+				"/oauth/listToken",
 				"/mobile/**").permitAll()
 			.anyRequest().authenticated()
 			.and().csrf().disable()

+ 181 - 0
pigx-auth/src/main/java/com/pig4cloud/pigx/auth/endpoint/PigxTokenEndpoint.java

@@ -0,0 +1,181 @@
+/*
+ *
+ *      Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the pig4cloud.com developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: lengleng (wangiegie@gmail.com)
+ *
+ */
+
+package com.pig4cloud.pigx.auth.endpoint;
+
+import cn.hutool.core.map.MapUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.pig4cloud.pigx.common.core.util.R;
+import com.pig4cloud.pigx.common.security.service.PigxUser;
+import lombok.AllArgsConstructor;
+import org.springframework.data.redis.core.ConvertingCursor;
+import org.springframework.data.redis.core.Cursor;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.ScanOptions;
+import org.springframework.data.redis.serializer.RedisSerializer;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.oauth2.common.OAuth2AccessToken;
+import org.springframework.security.oauth2.provider.OAuth2Authentication;
+import org.springframework.security.oauth2.provider.token.TokenStore;
+import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author lengleng
+ * @date 2018/6/24
+ * 删除token端点
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/oauth")
+public class PigxTokenEndpoint {
+	private static final String PIGX_OAUTH_ACCESS = "pigx_oauth:access:";
+	private final TokenStore tokenStore;
+	private final RedisTemplate redisTemplate;
+
+	/**
+	 * 退出token
+	 *
+	 * @param authHeader Authorization
+	 */
+	@GetMapping("/removeToken")
+	public R<Boolean> logout(@RequestHeader(value = "Authorization", required = false) String authHeader) {
+		if (StringUtils.hasText(authHeader)) {
+			String tokenValue = authHeader.replace("Bearer", "").trim();
+			OAuth2AccessToken accessToken = tokenStore.readAccessToken(tokenValue);
+			if (accessToken == null || StrUtil.isBlank(accessToken.getValue())) {
+				return new R<>(false, "退出失败,token 为空");
+			}
+			tokenStore.removeAccessToken(accessToken);
+		}
+
+		return new R<>(Boolean.TRUE);
+	}
+
+	/**
+	 * 令牌管理调用
+	 *
+	 * @param token token
+	 * @param from  内部调用标志
+	 * @return
+	 */
+	@DeleteMapping("/delToken/{token}")
+	public R<Boolean> delToken(@PathVariable("token") String token, @RequestHeader(required = false) String from) {
+		if (StrUtil.isBlank(from)) {
+			return null;
+		}
+		return new R<>(redisTemplate.delete(PIGX_OAUTH_ACCESS + token));
+	}
+
+
+	/**
+	 * 查询token
+	 *
+	 * @param params 分页参数
+	 * @param from   标志
+	 * @return
+	 */
+	@PostMapping("/listToken")
+	public Page tokenList(@RequestBody Map<String, Object> params, @RequestHeader(required = false) String from) {
+		if (StrUtil.isBlank(from)) {
+			return null;
+		}
+
+		List<Map<String, String>> list = new ArrayList<>();
+		//根据分页参数获取对应数据
+		List<String> pages = findKeysForPage(PIGX_OAUTH_ACCESS + "*", MapUtil.getInt(params, "page"), MapUtil.getInt(params, "limit"));
+
+		for (String page : pages) {
+			String accessToken = StrUtil.subAfter(page, PIGX_OAUTH_ACCESS, true);
+			OAuth2AccessToken token = tokenStore.readAccessToken(accessToken);
+			Map<String, String> map = new HashMap<>(8);
+
+
+			map.put("token_type", token.getTokenType());
+			map.put("token_value", token.getValue());
+			map.put("expires_in", token.getExpiresIn() + "");
+
+
+			OAuth2Authentication oAuth2Auth = tokenStore.readAuthentication(token);
+			Authentication authentication = oAuth2Auth.getUserAuthentication();
+
+			map.put("client_id", oAuth2Auth.getOAuth2Request().getClientId());
+			map.put("grant_type", oAuth2Auth.getOAuth2Request().getGrantType());
+
+			if (authentication instanceof UsernamePasswordAuthenticationToken) {
+				UsernamePasswordAuthenticationToken authenticationToken = (UsernamePasswordAuthenticationToken) authentication;
+
+				if (authenticationToken.getPrincipal() instanceof PigxUser) {
+					PigxUser user = (PigxUser) authenticationToken.getPrincipal();
+					map.put("user_id", user.getId() + "");
+					map.put("user_name", user.getUsername() + "");
+				}
+			} else if (authentication instanceof PreAuthenticatedAuthenticationToken) {
+				//刷新token方式
+				PreAuthenticatedAuthenticationToken authenticationToken = (PreAuthenticatedAuthenticationToken) authentication;
+				if (authenticationToken.getPrincipal() instanceof PigxUser) {
+					PigxUser user = (PigxUser) authenticationToken.getPrincipal();
+					map.put("user_id", user.getId() + "");
+					map.put("user_name", user.getUsername() + "");
+				}
+			}
+			list.add(map);
+		}
+
+		Page result = new Page(MapUtil.getInt(params, "page"), MapUtil.getInt(params, "limit"));
+		result.setRecords(list);
+		result.setTotal(redisTemplate.keys(PIGX_OAUTH_ACCESS + "*").size());
+		return result;
+	}
+
+	private List<String> findKeysForPage(String patternKey, int pageNum, int pageSize) {
+		ScanOptions options = ScanOptions.scanOptions().match(patternKey).build();
+		RedisSerializer<String> redisSerializer = (RedisSerializer<String>) redisTemplate.getKeySerializer();
+		Cursor cursor = (Cursor) redisTemplate.executeWithStickyConnection(redisConnection -> {
+			return new ConvertingCursor<>(redisConnection.scan(options), redisSerializer::deserialize);
+		});
+		List<String> result = new ArrayList<>();
+		int tmpIndex = 0;
+		int startIndex = (pageNum - 1) * pageSize;
+		int end = pageNum * pageSize;
+
+		assert cursor != null;
+		while (cursor.hasNext()) {
+			if (tmpIndex >= startIndex && tmpIndex < end) {
+				result.add(cursor.next().toString());
+				tmpIndex++;
+				continue;
+			}
+			if (tmpIndex >= end) {
+				break;
+			}
+			tmpIndex++;
+			cursor.next();
+		}
+		return result;
+	}
+}

+ 0 - 60
pigx-auth/src/main/java/com/pig4cloud/pigx/auth/endpoint/RevokeTokenEndpoint.java

@@ -1,60 +0,0 @@
-/*
- *
- *      Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- *  this list of conditions and the following disclaimer.
- *  Redistributions in binary form must reproduce the above copyright
- *  notice, this list of conditions and the following disclaimer in the
- *  documentation and/or other materials provided with the distribution.
- *  Neither the name of the pig4cloud.com developer nor the names of its
- *  contributors may be used to endorse or promote products derived from
- *  this software without specific prior written permission.
- *  Author: lengleng (wangiegie@gmail.com)
- *
- */
-
-package com.pig4cloud.pigx.auth.endpoint;
-
-import cn.hutool.core.util.StrUtil;
-import com.pig4cloud.pigx.common.core.util.R;
-import lombok.AllArgsConstructor;
-import org.springframework.security.oauth2.common.OAuth2AccessToken;
-import org.springframework.security.oauth2.provider.token.TokenStore;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestHeader;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author lengleng
- * @date 2018/6/24
- * 删除token端点
- */
-@RestController
-@AllArgsConstructor
-public class RevokeTokenEndpoint {
-	private final TokenStore tokenStore;
-
-	/**
-	 * 删除token
-	 *
-	 * @param authHeader Authorization
-	 */
-	@GetMapping("/oauth/removeToken")
-	public R<Boolean> logout(@RequestHeader(value = "Authorization", required = false) String authHeader) {
-		if (StringUtils.hasText(authHeader)) {
-			String tokenValue = authHeader.replace("Bearer", "").trim();
-			OAuth2AccessToken accessToken = tokenStore.readAccessToken(tokenValue);
-			if (accessToken == null || StrUtil.isBlank(accessToken.getValue())) {
-				return new R<>(false, "退出失败,token 为空");
-			}
-			tokenStore.removeAccessToken(accessToken);
-		}
-
-		return new R<>(Boolean.TRUE);
-	}
-}

+ 4 - 2
pigx-common/pigx-common-core/pom.xml

@@ -72,8 +72,10 @@
 		</dependency>
 		<!--jacksonJSR310规范-->
 		<dependency>
-			<groupId>com.fasterxml.jackson.datatype</groupId>
-			<artifactId>jackson-datatype-jsr310</artifactId>
+			<groupId>com.fasterxml.jackson.module</groupId>
+			<artifactId>jackson-modules-java8</artifactId>
+			<version>${jackson.modules}</version>
+			<type>pom</type>
 		</dependency>
 	</dependencies>
 </project>

+ 17 - 23
pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/config/JacksonConfig.java

@@ -21,20 +21,13 @@ package com.pig4cloud.pigx.common.core.config;
 
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
-import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
-import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
-import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
-import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
-import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
-import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import org.springframework.boot.autoconfigure.AutoConfigureBefore;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-import java.time.format.DateTimeFormatter;
+import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
 
 /**
  * JacksonConfig
@@ -43,24 +36,25 @@ import java.time.format.DateTimeFormatter;
  * @date: 2018/7/28  12:29
  */
 @Configuration
+@ConditionalOnClass(ObjectMapper.class)
+@AutoConfigureBefore(JacksonAutoConfiguration.class)
 public class JacksonConfig {
 	/**
-	 * 处理序列化后的1.8的日期时间格式
+	 * 针对JDK 1.8 特殊处理
+	 * .registerModule(new ParameterNamesModule())
+	 * .registerModule(new Jdk8Module())
+	 * .registerModule(new JavaTimeModule()); // new module, NOT JSR310Module
 	 *
 	 * @return
 	 */
 	@Bean
-	public ObjectMapper getObjectMapper() {
-		ObjectMapper objectMapper = new ObjectMapper();
-		JavaTimeModule javaTimeModule = new JavaTimeModule();
-		javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
-		javaTimeModule.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
-		javaTimeModule.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern("HH:mm:ss")));
-		javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
-		javaTimeModule.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
-		javaTimeModule.addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern("HH:mm:ss")));
-		objectMapper.registerModule(javaTimeModule);
+	public ObjectMapper getObjectMapper(Jackson2ObjectMapperBuilder builder) {
+		ObjectMapper objectMapper = builder.createXmlMapper(false).build();
+		objectMapper.findAndRegisterModules();
+		// 忽略json字符串中不识别的属性
 		objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+		// 忽略无法转换的对象
+		objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
 		return objectMapper;
 	}
 }

+ 0 - 15
pigx-common/pigx-common-log/src/main/java/com/pig4cloud/pigx/common/log/util/SysLogUtils.java

@@ -19,7 +19,6 @@
 
 package com.pig4cloud.pigx.common.log.util;
 
-import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.URLUtil;
 import cn.hutool.http.HttpUtil;
 import com.pig4cloud.pigx.admin.api.entity.SysLog;
@@ -36,22 +35,8 @@ import javax.servlet.http.HttpServletRequest;
  * @author L.cm
  */
 public class SysLogUtils {
-
-	private static final String PASSWORD = "password";
-
 	public static SysLog getSysLog() {
 		HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
-		StringBuilder params = new StringBuilder();
-		request.getParameterMap().forEach((key, values) -> {
-			params.append(key).append("=");
-			if (PASSWORD.equalsIgnoreCase(key)) {
-				params.append("******");
-			} else {
-				params.append(ArrayUtil.toString(values));
-			}
-			params.append("&");
-		});
-
 		SysLog sysLog = new SysLog();
 		sysLog.setCreateBy(SecurityUtils.getUser().getUsername());
 		sysLog.setType(CommonConstant.STATUS_NORMAL);

+ 87 - 0
pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/PigxResourceServerTokenRelayAutoConfiguration.java

@@ -0,0 +1,87 @@
+package com.pig4cloud.pigx.common.security.component;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.AllNestedConditions;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
+import org.springframework.boot.autoconfigure.security.oauth2.OAuth2AutoConfiguration;
+import org.springframework.cloud.security.oauth2.client.AccessTokenContextRelay;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.oauth2.client.OAuth2ClientContext;
+import org.springframework.security.oauth2.config.annotation.web.configuration.OAuth2ClientConfiguration;
+import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfiguration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.lang.annotation.*;
+
+/**
+ * @author lengleng
+ * @date 2018/9/5
+ * 注入AccessTokenContextRelay 解决feign 传递token 为空问题
+ */
+@Configuration
+@AutoConfigureAfter(OAuth2AutoConfiguration.class)
+@ConditionalOnWebApplication
+@ConditionalOnProperty("security.oauth2.client.client-id")
+public class PigxResourceServerTokenRelayAutoConfiguration {
+
+	@Bean
+	public AccessTokenContextRelay accessTokenContextRelay(OAuth2ClientContext context) {
+		return new AccessTokenContextRelay(context);
+	}
+
+	@Configuration
+	public static class ResourceServerTokenRelayRegistrationAutoConfiguration implements WebMvcConfigurer {
+		@Autowired
+		AccessTokenContextRelay accessTokenContextRelay;
+
+		@Override
+		public void addInterceptors(InterceptorRegistry registry) {
+			registry.addInterceptor(
+				new HandlerInterceptorAdapter() {
+					@Override
+					public boolean preHandle(HttpServletRequest request,
+											 HttpServletResponse response, Object handler) throws Exception {
+						accessTokenContextRelay.copyToken();
+						return true;
+					}
+				}
+
+			);
+		}
+
+	}
+
+	@Target({ElementType.TYPE, ElementType.METHOD})
+	@Retention(RetentionPolicy.RUNTIME)
+	@Documented
+	@Conditional(OAuth2OnClientInResourceServerCondition.class)
+	@interface ConditionalOnOAuth2ClientInResourceServer {
+
+	}
+
+	private static class OAuth2OnClientInResourceServerCondition
+		extends AllNestedConditions {
+
+		public OAuth2OnClientInResourceServerCondition() {
+			super(ConfigurationPhase.REGISTER_BEAN);
+		}
+
+		@ConditionalOnBean(ResourceServerConfiguration.class)
+		static class Server {
+		}
+
+		@ConditionalOnBean(OAuth2ClientConfiguration.class)
+		static class Client {
+		}
+
+	}
+}

+ 82 - 0
pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/feign/EnablePigxFeignClients.java

@@ -0,0 +1,82 @@
+/*
+ *    Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.common.security.feign;
+
+import com.pig4cloud.pigx.admin.api.feign.RemoteLogService;
+import com.pig4cloud.pigx.admin.api.feign.RemoteUserService;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+
+import java.lang.annotation.*;
+
+/**
+ * @author lengleng
+ * @date 2018/9/5
+ */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@EnableFeignClients
+public @interface EnablePigxFeignClients {
+	/**
+	 * Alias for the {@link #basePackages()} attribute. Allows for more concise annotation
+	 * declarations e.g.: {@code @ComponentScan("org.my.pkg")} instead of
+	 * {@code @ComponentScan(basePackages="org.my.pkg")}.
+	 *
+	 * @return the array of 'basePackages'.
+	 */
+	String[] value() default {};
+
+	/**
+	 * Base packages to scan for annotated components.
+	 * <p>
+	 * {@link #value()} is an alias for (and mutually exclusive with) this attribute.
+	 * <p>
+	 * Use {@link #basePackageClasses()} for a type-safe alternative to String-based
+	 * package names.
+	 *
+	 * @return the array of 'basePackages'.
+	 */
+	String[] basePackages() default {};
+
+	/**
+	 * Type-safe alternative to {@link #basePackages()} for specifying the packages to
+	 * scan for annotated components. The package of each class specified will be scanned.
+	 * <p>
+	 * Consider creating a special no-op marker class or interface in each package that
+	 * serves no purpose other than being referenced by this attribute.
+	 *
+	 * @return the array of 'basePackageClasses'.
+	 */
+	Class<?>[] basePackageClasses() default {};
+
+	/**
+	 * A custom <code>@Configuration</code> for all feign clients. Can contain override
+	 * <code>@Bean</code> definition for the pieces that make up the client, for instance
+	 * {@link feign.codec.Decoder}, {@link feign.codec.Encoder}, {@link feign.Contract}.
+	 *
+	 * @see FeignClientsConfiguration for the defaults
+	 */
+	Class<?>[] defaultConfiguration() default {};
+
+	/**
+	 * List of classes annotated with @FeignClient. If not empty, disables classpath scanning.
+	 *
+	 * @return
+	 */
+	Class<?>[] clients() default {RemoteUserService.class, RemoteLogService.class};
+}

+ 1 - 0
pigx-common/pigx-common-security/src/main/resources/META-INF/spring.factories

@@ -2,6 +2,7 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
   com.pig4cloud.pigx.common.security.component.PermissionService,\
   com.pig4cloud.pigx.common.security.component.PigAccessDeniedHandler,\
   com.pig4cloud.pigx.common.security.component.ResourceAuthExceptionEntryPoint,\
+  com.pig4cloud.pigx.common.security.component.PigxResourceServerTokenRelayAutoConfiguration,\
   com.pig4cloud.pigx.common.security.feign.PigxFeignClientConfiguration,\
   com.pig4cloud.pigx.common.security.service.PigxUserDetailsServiceImpl,\
   com.pig4cloud.pigx.common.security.social.QqSocialConfig,\

+ 0 - 2
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/feign/TransactionRestTemplateInterceptor.java

@@ -21,8 +21,6 @@ import com.codingapi.tx.aop.bean.TxTransactionLocal;
 import feign.RequestInterceptor;
 import feign.RequestTemplate;
 import lombok.extern.slf4j.Slf4j;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  *@author LCN on 2017/6/26.

+ 1 - 1
pigx-gateway/src/main/java/com/pig4cloud/pigx/gateway/config/RouterFunctionConfiguration.java

@@ -45,7 +45,7 @@ public class RouterFunctionConfiguration {
 	@Bean
 	public RouterFunction routerFunction() {
 		return RouterFunctions.route(
-			RequestPredicates.GET("/fallback")
+			RequestPredicates.path("/fallback")
 				.and(RequestPredicates.accept(MediaType.TEXT_PLAIN)), hystrixFallbackHandler)
 			.andRoute(RequestPredicates.GET("/code")
 				.and(RequestPredicates.accept(MediaType.TEXT_PLAIN)), imageCodeHandler)

+ 1 - 1
pigx-gateway/src/main/java/com/pig4cloud/pigx/gateway/filter/PreviewGatewayFilter.java

@@ -29,7 +29,7 @@ import org.springframework.stereotype.Component;
 
 /**
  * @author lengleng
- * @date 2018/8/421
+ * @date 2018/8/21
  * 演示环境过滤处理
  */
 @Slf4j

+ 2 - 2
pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/RemoteLogService.java

@@ -20,7 +20,7 @@
 package com.pig4cloud.pigx.admin.api.feign;
 
 import com.pig4cloud.pigx.admin.api.entity.SysLog;
-import com.pig4cloud.pigx.admin.api.feign.fallback.RemoteLogServiceFallbackImpl;
+import com.pig4cloud.pigx.admin.api.feign.factory.RemoteLogServiceFallbackFactory;
 import com.pig4cloud.pigx.common.core.constant.ServiceNameConstant;
 import com.pig4cloud.pigx.common.core.util.R;
 import org.springframework.cloud.openfeign.FeignClient;
@@ -31,7 +31,7 @@ import org.springframework.web.bind.annotation.RequestBody;
  * @author lengleng
  * @date 2018/6/28
  */
-@FeignClient(value = ServiceNameConstant.UMPS_SERVICE, fallback = RemoteLogServiceFallbackImpl.class)
+@FeignClient(value = ServiceNameConstant.UMPS_SERVICE, fallbackFactory = RemoteLogServiceFallbackFactory.class)
 public interface RemoteLogService {
 	/**
 	 * 保存日志

+ 54 - 0
pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/RemoteTokenService.java

@@ -0,0 +1,54 @@
+/*
+ *    Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.admin.api.feign;
+
+import com.baomidou.mybatisplus.plugins.Page;
+import com.pig4cloud.pigx.admin.api.feign.factory.RemoteTokenServiceFallbackFactory;
+import com.pig4cloud.pigx.common.core.constant.ServiceNameConstant;
+import com.pig4cloud.pigx.common.core.util.R;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+/**
+ * @author lengleng
+ * @date 2018/9/4
+ */
+@FeignClient(value = ServiceNameConstant.AUTH_SERVICE, fallbackFactory = RemoteTokenServiceFallbackFactory.class)
+public interface RemoteTokenService {
+	/**
+	 * 分页查询token 信息
+	 *
+	 * @param params 分页参数
+	 * @param from   内部调用标志
+	 * @return page
+	 */
+	@PostMapping("/oauth/listToken")
+	Page selectPage(@RequestBody Map<String, Object> params, @RequestHeader("from") String from);
+
+	/**
+	 * 删除token
+	 *
+	 * @param token token
+	 * @param from  调用标志
+	 * @return
+	 */
+	@DeleteMapping("/oauth/delToken/{token}")
+	R<Boolean> deleteTokenById(@PathVariable("token") String token, @RequestHeader("from") String from);
+}

+ 38 - 0
pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/factory/RemoteLogServiceFallbackFactory.java

@@ -0,0 +1,38 @@
+/*
+ *    Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.admin.api.feign.factory;
+
+import com.pig4cloud.pigx.admin.api.feign.RemoteLogService;
+import com.pig4cloud.pigx.admin.api.feign.fallback.RemoteLogServiceFallbackImpl;
+import feign.hystrix.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author lengleng
+ * @date 2018/9/4
+ */
+@Component
+public class RemoteLogServiceFallbackFactory implements FallbackFactory<RemoteLogService> {
+
+	@Override
+	public RemoteLogService create(Throwable throwable) {
+		RemoteLogServiceFallbackImpl remoteLogServiceFallback = new RemoteLogServiceFallbackImpl();
+		remoteLogServiceFallback.setCause(throwable);
+		return remoteLogServiceFallback;
+	}
+}

+ 38 - 0
pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/factory/RemoteTokenServiceFallbackFactory.java

@@ -0,0 +1,38 @@
+/*
+ *    Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.admin.api.feign.factory;
+
+import com.pig4cloud.pigx.admin.api.feign.RemoteTokenService;
+import com.pig4cloud.pigx.admin.api.feign.fallback.RemoteTokenServiceFallbackImpl;
+import feign.hystrix.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author lengleng
+ * @date 2018/9/4
+ */
+@Component
+public class RemoteTokenServiceFallbackFactory implements FallbackFactory<RemoteTokenService> {
+
+	@Override
+	public RemoteTokenService create(Throwable throwable) {
+		RemoteTokenServiceFallbackImpl remoteTokenServiceFallback = new RemoteTokenServiceFallbackImpl();
+		remoteTokenServiceFallback.setCause(throwable);
+		return remoteTokenServiceFallback;
+	}
+}

+ 4 - 1
pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/fallback/RemoteLogServiceFallbackImpl.java

@@ -22,6 +22,7 @@ package com.pig4cloud.pigx.admin.api.feign.fallback;
 import com.pig4cloud.pigx.admin.api.entity.SysLog;
 import com.pig4cloud.pigx.admin.api.feign.RemoteLogService;
 import com.pig4cloud.pigx.common.core.util.R;
+import lombok.Setter;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
@@ -32,6 +33,8 @@ import org.springframework.stereotype.Component;
 @Slf4j
 @Component
 public class RemoteLogServiceFallbackImpl implements RemoteLogService {
+	@Setter
+	private Throwable cause;
 
 	/**
 	 * 保存日志
@@ -41,7 +44,7 @@ public class RemoteLogServiceFallbackImpl implements RemoteLogService {
 	 */
 	@Override
 	public R<Boolean> saveLog(SysLog sysLog) {
-		log.error("feign 插入日志失败:{}");
+		log.error("feign 插入日志失败", cause);
 		return null;
 	}
 }

+ 66 - 0
pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/fallback/RemoteTokenServiceFallbackImpl.java

@@ -0,0 +1,66 @@
+/*
+ *    Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.admin.api.feign.fallback;
+
+import com.baomidou.mybatisplus.plugins.Page;
+import com.pig4cloud.pigx.admin.api.feign.RemoteTokenService;
+import com.pig4cloud.pigx.common.core.util.R;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @author lengleng
+ * @date 2018/9/4
+ * feign token  fallback
+ */
+@Slf4j
+@Component
+public class RemoteTokenServiceFallbackImpl implements RemoteTokenService {
+	@Setter
+	private Throwable cause;
+
+	/**
+	 * 分页查询token 信息
+	 *
+	 * @param params 分页参数
+	 * @param from   内部调用标志
+	 * @return page
+	 */
+	@Override
+	public Page selectPage(Map<String, Object> params, String from) {
+		log.error("调用认证中心查询token 失败", cause);
+		return null;
+	}
+
+	/**
+	 * 删除token
+	 *
+	 *
+	 * @param s
+	 * @param id
+	 * @return
+	 */
+	@Override
+	public R<Boolean> deleteTokenById(String s, String id) {
+		log.error("删除token 失败 {}", id, cause);
+		return null;
+	}
+}

+ 4 - 1
pigx-upms/pigx-upms-api/src/main/resources/META-INF/spring.factories

@@ -1,4 +1,7 @@
 org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
   com.pig4cloud.pigx.admin.api.feign.fallback.RemoteUserServiceFallbackImpl,\
   com.pig4cloud.pigx.admin.api.feign.fallback.RemoteLogServiceFallbackImpl,\
-  com.pig4cloud.pigx.admin.api.feign.factory.RemoteUserServiceFallbackFactory
+  com.pig4cloud.pigx.admin.api.feign.fallback.RemoteTokenServiceFallbackImpl,\
+  com.pig4cloud.pigx.admin.api.feign.factory.RemoteUserServiceFallbackFactory,\
+  com.pig4cloud.pigx.admin.api.feign.factory.RemoteLogServiceFallbackFactory,\
+  com.pig4cloud.pigx.admin.api.feign.factory.RemoteTokenServiceFallbackFactory

+ 2 - 2
pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/PigxAdminApplication.java

@@ -20,10 +20,10 @@
 package com.pig4cloud.pigx.admin;
 
 
+import com.pig4cloud.pigx.common.security.feign.EnablePigxFeignClients;
 import com.pig4cloud.pigx.common.swagger.annotation.EnablePigxSwagger2;
 import org.springframework.boot.SpringApplication;
 import org.springframework.cloud.client.SpringCloudApplication;
-import org.springframework.cloud.openfeign.EnableFeignClients;
 
 /**
  * @author lengleng
@@ -32,7 +32,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
  */
 @EnablePigxSwagger2
 @SpringCloudApplication
-@EnableFeignClients({"com.pig4cloud.pigx.admin.api.feign"})
+@EnablePigxFeignClients
 public class PigxAdminApplication {
 	public static void main(String[] args) {
 		SpringApplication.run(PigxAdminApplication.class, args);

+ 63 - 0
pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/controller/TokenController.java

@@ -0,0 +1,63 @@
+/*
+ *    Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.admin.controller;
+
+import com.baomidou.mybatisplus.plugins.Page;
+import com.pig4cloud.pigx.admin.api.feign.RemoteTokenService;
+import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
+import com.pig4cloud.pigx.common.core.util.R;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+/**
+ * @author lengleng
+ * @date 2018/9/4
+ * token 管理
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/token")
+public class TokenController {
+	private final RemoteTokenService remoteTokenService;
+
+	/**
+	 * 分页token 信息
+	 *
+	 * @param params 参数集
+	 * @return token集合
+	 */
+	@GetMapping("/page")
+	public Page token(@RequestParam Map<String, Object> params) {
+		return remoteTokenService.selectPage(params, SecurityConstants.FROM_IN);
+	}
+
+	/**
+	 * 删除
+	 *
+	 * @param id ID
+	 * @return success/false
+	 */
+	@DeleteMapping("/{id}")
+	@PreAuthorize("@pms.hasPermission('sys_token_del')")
+	public R<Boolean> delete(@PathVariable String id) {
+		return remoteTokenService.deleteTokenById(id, SecurityConstants.FROM_IN);
+	}
+}

+ 8 - 5
pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysUserMapper.java

@@ -48,8 +48,8 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
 	/**
 	 * 分页查询用户信息(含角色)
 	 *
-	 * @param query    查询条件
-	 * @param username 用户名
+	 * @param query     查询条件
+	 * @param username  用户名
 	 * @param dataScope
 	 * @return list
 	 */
@@ -65,16 +65,19 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
 
 	/**
 	 * 通过用户名查找已经删除的用户
+	 *
 	 * @param username 用户名
 	 * @return 用户对象
 	 */
-	SysUser selectDeletedUserByUsername(@Param("username")String username);
+	SysUser selectDeletedUserByUsername(@Param("username") String username);
 
 	/**
 	 * 根据用户名删除用户(真实删除)
-	 * @param username
+	 *
+	 * @param username username
+	 * @param userId   userId
 	 * @return
 	 */
-	Boolean deleteSysUserByUsernameAndUserId(@Param("username")String username,@Param("userId")Integer userId);
+	Boolean deleteSysUserByUsernameAndUserId(@Param("username") String username, @Param("userId") Integer userId);
 
 }

+ 5 - 2
pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysUserService.java

@@ -87,6 +87,7 @@ public interface SysUserService extends IService<SysUser> {
 
 	/**
 	 * 通过用户名查找已经删除的用户
+	 *
 	 * @param username 用户名
 	 * @return
 	 */
@@ -94,10 +95,12 @@ public interface SysUserService extends IService<SysUser> {
 
 	/**
 	 * 根据用户名删除用户(真实删除)
-	 * @param username
+	 *
+	 * @param username username
+	 * @param userId   userId
 	 * @return
 	 */
-	Boolean deleteSysUserByUsernameAndUserId(String username,Integer userId);
+	Boolean deleteSysUserByUsernameAndUserId(String username, Integer userId);
 
 
 }

+ 7 - 3
pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysRoleMenuServiceImpl.java

@@ -20,6 +20,7 @@
 package com.pig4cloud.pigx.admin.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.pig4cloud.pigx.admin.api.entity.SysRoleMenu;
@@ -59,11 +60,14 @@ public class SysRoleMenuServiceImpl extends ServiceImpl<SysRoleMenuMapper, SysRo
 		SysRoleMenu condition = new SysRoleMenu();
 		condition.setRoleId(roleId);
 		this.delete(new EntityWrapper<>(condition));
-		List<SysRoleMenu> roleMenuList = new ArrayList<>();
-		List<String> menuIdList = Arrays.asList(menuIds.split(","));
-		if (CollUtil.isEmpty(menuIdList)) {
+
+		if (StrUtil.isBlank(menuIds)) {
 			return Boolean.TRUE;
 		}
+
+		List<SysRoleMenu> roleMenuList = new ArrayList<>();
+		List<String> menuIdList = Arrays.asList(menuIds.split(","));
+
 		for (String menuId : menuIdList) {
 			SysRoleMenu roleMenu = new SysRoleMenu();
 			roleMenu.setRoleId(roleId);

+ 1 - 1
pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysUserServiceImpl.java

@@ -78,7 +78,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
 	 * @return
 	 */
 	@Override
-	@Cacheable(value = "user_details", key = "#username")
+	@Cacheable(value = "user_details", key = "#username",unless = "#result == null")
 	public UserInfo findUserInfo(String type, String username) {
 		SysUser condition = new SysUser();
 		if (EnumLoginType.PWD.getType().equals(type)) {

+ 5 - 9
pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/mapper/SysGeneratorMapper.java

@@ -18,6 +18,7 @@
 package com.pig4cloud.pigx.codegen.mapper;
 
 import com.pig4cloud.pigx.common.core.util.Query;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 import java.util.Map;
@@ -34,20 +35,14 @@ public interface SysGeneratorMapper {
 	 * 分页查询表格
 	 *
 	 * @param params
+	 * @param tableName
 	 * @return
 	 */
-	List<Map<String, Object>> queryList(Query params);
-
-	/**
-	 * 查询表数量
-	 *
-	 * @param query
-	 * @return
-	 */
-	int queryTotal(Map query);
+	List<Map<String, Object>> queryList(Query params, @Param("tableName") Object tableName);
 
 	/**
 	 * 查询表信息
+	 *
 	 * @param tableName 表名称
 	 * @return
 	 */
@@ -55,6 +50,7 @@ public interface SysGeneratorMapper {
 
 	/**
 	 * 查询表列信息
+	 *
 	 * @param tableName 表名称
 	 * @return
 	 */

+ 3 - 2
pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/service/impl/SysGeneratorServiceImpl.java

@@ -50,8 +50,9 @@ public class SysGeneratorServiceImpl implements SysGeneratorService {
 	 * @return
 	 */
 	@Override
-	public List<Map<String,Object>> queryPage(Query query) {
-		return sysGeneratorMapper.queryList(query);
+	public List<Map<String, Object>> queryPage(Query query) {
+		Object tableName = query.getCondition().get("tableName");
+		return sysGeneratorMapper.queryList(query, tableName);
 	}
 
 	/**

+ 1 - 1
pigx-visual/pigx-codegen/src/main/resources/template/Mapper.xml.vm

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
-<mapper namespace="${package}.${moduleName}.mapper.${className}Mappper">
+<mapper namespace="${package}.${moduleName}.mapper.${className}Mapper">
 
 	<!-- 可根据自己的需求,是否要使用 -->
     <resultMap type="${package}.${moduleName}.entity.${className}" id="${classname}Map">

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/compensate/service/impl/CompensateServiceImpl.java

@@ -131,7 +131,7 @@ public class CompensateServiceImpl implements CompensateService {
 		logger.info("Auto Compensate->" + json);
 		//自动补偿业务执行...
 		final int tryTime = configReader.getCompensateTryTime();
-		boolean autoExecuteRes = false;
+		boolean autoExecuteRes;
 		try {
 			int executeCount = 0;
 			autoExecuteRes = executeCompensate_(json);

+ 2 - 1
pom.xml

@@ -37,7 +37,7 @@
 	</parent>
 
 	<properties>
-		<pigx.version>1.6.0</pigx.version>
+		<pigx.version>1.6.1</pigx.version>
 		<spring-boot.version>2.0.4.RELEASE</spring-boot.version>
 		<spring-cloud.version>Finchley.SR1</spring-cloud.version>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -55,6 +55,7 @@
 		<jasypt.version>2.1.0</jasypt.version>
 		<elastic-job-lite.version>2.1.5</elastic-job-lite.version>
 		<security.oauth.version>2.3.3.RELEASE</security.oauth.version>
+		<jackson.modules>2.9.6</jackson.modules>
 		<docker.url>http://192.168.0.13:4243</docker.url>
 		<registry.url>192.168.0.13:5000</registry.url>
 	</properties>