From ae5c5653a841eb712109b90a974a3a89571277c0 Mon Sep 17 00:00:00 2001 From: lbw Date: Tue, 13 Sep 2022 16:56:01 +0800 Subject: [PATCH 1/4] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=20=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E9=93=BE=E6=8E=A5=E5=A4=B1=E8=B4=A5=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=99=BB=E5=BD=95=E6=8F=90=E7=A4=BAclientId=20?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../security/service/PigRemoteRegisteredClientRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigRemoteRegisteredClientRepository.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigRemoteRegisteredClientRepository.java index a79b4d73..d99a9817 100644 --- a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigRemoteRegisteredClientRepository.java +++ b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigRemoteRegisteredClientRepository.java @@ -88,7 +88,7 @@ public class PigRemoteRegisteredClientRepository implements RegisteredClientRepo SysOauthClientDetails clientDetails = RetOps .of(clientDetailsService.getClientDetailsById(clientId, SecurityConstants.FROM_IN)).getData() - .orElseThrow(() -> new OAuthClientException("clientId 不合法")); + .orElseThrow(() -> new OAuthClientException("客户端查询异常,请检查数据库链接")); RegisteredClient.Builder builder = RegisteredClient.withId(clientDetails.getClientId()) .clientId(clientDetails.getClientId()) From 0cbf6948fd21f126b3984a124266c3c335c78c75 Mon Sep 17 00:00:00 2001 From: "qifeng.zheng" <523179414@qq.com> Date: Thu, 15 Sep 2022 14:48:20 +0800 Subject: [PATCH 2/4] :arrow_up: Upgrading dependencies. spring cloud alibaba 2021.0.4.0 --- README.md | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f395e22e..6b2839af 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ | ---------------------- |------------| | Spring Boot | 2.7.3 | | Spring Cloud | 2021.0.4 | -| Spring Cloud Alibaba | 2021.0.1.0 | +| Spring Cloud Alibaba | 2021.0.4.0 | | Spring Authorization Server | 0.3.1 | | Mybatis Plus | 3.5.2 | | hutool | 5.8.6 | diff --git a/pom.xml b/pom.xml index 01461aed..fa1c455b 100755 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 2.7.3 2021.0.4 - 2021.0.1.0 + 2021.0.4.0 UTF-8 1.8 1.8 From 53449842fee64ab2430670ef9a299564bfdb19ab Mon Sep 17 00:00:00 2001 From: Lht Date: Fri, 16 Sep 2022 00:10:12 +0800 Subject: [PATCH 3/4] :arrow_up: Upgrading dependencies. UP hutool 5.8.7 --- README.md | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6b2839af..6974e786 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ | Spring Cloud Alibaba | 2021.0.4.0 | | Spring Authorization Server | 0.3.1 | | Mybatis Plus | 3.5.2 | -| hutool | 5.8.6 | +| hutool | 5.8.7 | | Avue | 2.6.18 | ### 模块说明 diff --git a/pom.xml b/pom.xml index fa1c455b..18ac8279 100755 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ 1.8 2.7.4 0.3.1 - 5.8.6 + 5.8.7 3.5.1 2.2.2 2.3 From 37f94017ffe262890aef5651c4ee5bf03837e120 Mon Sep 17 00:00:00 2001 From: lbw Date: Fri, 16 Sep 2022 16:37:02 +0800 Subject: [PATCH 4/4] :arrow_up: Upgrading dependencies. seata 1.5.2 springbootadmin 2.7.5 --- README.md | 5 +- .../handle/GlobalBizExceptionHandler.java | 2 +- .../seata/config/SeataAutoConfiguration.java | 2 +- .../seata/spring/util/SpringProxyUtils.java | 177 ------------------ pom.xml | 2 +- 5 files changed, 6 insertions(+), 182 deletions(-) delete mode 100644 pig-common/pig-common-seata/src/main/java/io/seata/spring/util/SpringProxyUtils.java diff --git a/README.md b/README.md index 6974e786..582084a5 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,14 @@ Build Status Coverage Status Downloads + Downloads

## 系统说明 - 基于 Spring Cloud 2021 、Spring Boot 2.7、 OAuth2 的 RBAC **权限管理系统** -- 基于数据驱动视图的理念封装 element-ui,即使没有 vue 的使用经验也能快速上手 +- 基于数据驱动视图的理念封装 element-plus,即使没有 vue 的使用经验也能快速上手 - 提供对常见容器化支持 Docker、Kubernetes、Rancher2 支持 - 提供 lambda 、stream api 、webflux 的生产实践 @@ -43,7 +44,7 @@ | Spring Authorization Server | 0.3.1 | | Mybatis Plus | 3.5.2 | | hutool | 5.8.7 | -| Avue | 2.6.18 | +| Avue | 3.1.3 | ### 模块说明 diff --git a/pig-common/pig-common-feign/src/main/java/com/pig4cloud/pig/common/feign/sentinel/handle/GlobalBizExceptionHandler.java b/pig-common/pig-common-feign/src/main/java/com/pig4cloud/pig/common/feign/sentinel/handle/GlobalBizExceptionHandler.java index d81bf5df..89bad620 100644 --- a/pig-common/pig-common-feign/src/main/java/com/pig4cloud/pig/common/feign/sentinel/handle/GlobalBizExceptionHandler.java +++ b/pig-common/pig-common-feign/src/main/java/com/pig4cloud/pig/common/feign/sentinel/handle/GlobalBizExceptionHandler.java @@ -104,7 +104,7 @@ public class GlobalBizExceptionHandler { public R handleBodyValidException(MethodArgumentNotValidException exception) { List fieldErrors = exception.getBindingResult().getFieldErrors(); log.warn("参数绑定异常,ex = {}", fieldErrors.get(0).getDefaultMessage()); - return R.failed(fieldErrors.get(0).getDefaultMessage()); + return R.failed(String.format("%s %s", fieldErrors.get(0).getField(), fieldErrors.get(0).getDefaultMessage())); } /** diff --git a/pig-common/pig-common-seata/src/main/java/com/pig4cloud/pig/common/seata/config/SeataAutoConfiguration.java b/pig-common/pig-common-seata/src/main/java/com/pig4cloud/pig/common/seata/config/SeataAutoConfiguration.java index 1efe7cf3..94fe0122 100644 --- a/pig-common/pig-common-seata/src/main/java/com/pig4cloud/pig/common/seata/config/SeataAutoConfiguration.java +++ b/pig-common/pig-common-seata/src/main/java/com/pig4cloud/pig/common/seata/config/SeataAutoConfiguration.java @@ -12,7 +12,7 @@ import org.springframework.context.annotation.PropertySource; * @date 2022/3/29 */ @PropertySource(value = "classpath:seata-config.yml", factory = YamlPropertySourceFactory.class) -@EnableAutoDataSourceProxy +@EnableAutoDataSourceProxy(useJdkProxy = true) @Configuration(proxyBeanMethods = false) public class SeataAutoConfiguration { diff --git a/pig-common/pig-common-seata/src/main/java/io/seata/spring/util/SpringProxyUtils.java b/pig-common/pig-common-seata/src/main/java/io/seata/spring/util/SpringProxyUtils.java deleted file mode 100644 index 36650572..00000000 --- a/pig-common/pig-common-seata/src/main/java/io/seata/spring/util/SpringProxyUtils.java +++ /dev/null @@ -1,177 +0,0 @@ -/** - * @author lengleng - * @date 2022/3/29 - */ -package io.seata.spring.util; - -import io.seata.common.util.CollectionUtils; -import io.seata.rm.tcc.remoting.parser.DubboUtil; -import org.springframework.aop.TargetSource; -import org.springframework.aop.framework.Advised; -import org.springframework.aop.framework.AdvisedSupport; -import org.springframework.aop.support.AopUtils; - -import java.lang.reflect.Field; -import java.lang.reflect.Proxy; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -/** - * Proxy tools base on spring 主要解决 v1.4.2 兼容性问题 https://github.com/seata/seata/issues/3709 - * - * @author zhangsen - */ -public class SpringProxyUtils { - - private SpringProxyUtils() { - } - - /** - * Find target class class. - * @param proxy the proxy - * @return the class - * @throws Exception the exception - */ - public static Class findTargetClass(Object proxy) throws Exception { - if (proxy == null) { - return null; - } - if (AopUtils.isAopProxy(proxy) && proxy instanceof Advised) { - // #issue 3709 - final TargetSource targetSource = ((Advised) proxy).getTargetSource(); - if (!targetSource.isStatic()) { - return targetSource.getTargetClass(); - } - return findTargetClass(targetSource.getTarget()); - } - return proxy.getClass(); - } - - public static Class[] findInterfaces(Object proxy) throws Exception { - if (AopUtils.isJdkDynamicProxy(proxy)) { - AdvisedSupport advised = getAdvisedSupport(proxy); - return getInterfacesByAdvised(advised); - } - else { - return new Class[] {}; - } - } - - private static Class[] getInterfacesByAdvised(AdvisedSupport advised) { - Class[] interfaces = advised.getProxiedInterfaces(); - if (interfaces.length > 0) { - return interfaces; - } - else { - throw new IllegalStateException("Find the jdk dynamic proxy class that does not implement the interface"); - } - } - - /** - * Gets advised support. - * @param proxy the proxy - * @return the advised support - * @throws Exception the exception - */ - public static AdvisedSupport getAdvisedSupport(Object proxy) throws Exception { - Field h; - if (AopUtils.isJdkDynamicProxy(proxy)) { - h = proxy.getClass().getSuperclass().getDeclaredField("h"); - } - else { - h = proxy.getClass().getDeclaredField("CGLIB$CALLBACK_0"); - } - h.setAccessible(true); - Object dynamicAdvisedInterceptor = h.get(proxy); - Field advised = dynamicAdvisedInterceptor.getClass().getDeclaredField("advised"); - advised.setAccessible(true); - return (AdvisedSupport) advised.get(dynamicAdvisedInterceptor); - } - - /** - * Is proxy boolean. - * @param bean the bean - * @return the boolean - */ - public static boolean isProxy(Object bean) { - if (bean == null) { - return false; - } - // check dubbo proxy ? - return DubboUtil.isDubboProxyName(bean.getClass().getName()) - || (Proxy.class.isAssignableFrom(bean.getClass()) || AopUtils.isAopProxy(bean)); - } - - /** - * Get the target class , get the interface of its agent if it is a Proxy - * @param proxy the proxy - * @return target interface - * @throws Exception the exception - */ - public static Class getTargetInterface(Object proxy) throws Exception { - if (proxy == null) { - throw new java.lang.IllegalArgumentException("proxy can not be null"); - } - - // jdk proxy - if (Proxy.class.isAssignableFrom(proxy.getClass())) { - Proxy p = (Proxy) proxy; - return p.getClass().getInterfaces()[0]; - } - - return getTargetClass(proxy); - } - - /** - * Get the class type of the proxy target object, if hadn't a target object, return - * the interface of the proxy - * @param proxy the proxy - * @return target interface - * @throws Exception the exception - */ - protected static Class getTargetClass(Object proxy) throws Exception { - if (proxy == null) { - throw new java.lang.IllegalArgumentException("proxy can not be null"); - } - // not proxy - if (!AopUtils.isAopProxy(proxy)) { - return proxy.getClass(); - } - AdvisedSupport advisedSupport = getAdvisedSupport(proxy); - Object target = advisedSupport.getTargetSource().getTarget(); - /* - * the Proxy of sofa:reference has no target - */ - if (target == null) { - if (CollectionUtils.isNotEmpty(advisedSupport.getProxiedInterfaces())) { - return advisedSupport.getProxiedInterfaces()[0]; - } - else { - return proxy.getClass(); - } - } - else { - return getTargetClass(target); - } - } - - /** - * get the all interfaces of bean, if the bean is null, then return empty array - * @param bean the bean - * @return target interface - */ - public static Class[] getAllInterfaces(Object bean) { - Set> interfaces = new HashSet<>(); - if (bean != null) { - Class clazz = bean.getClass(); - while (!Object.class.getName().equalsIgnoreCase(clazz.getName())) { - Class[] clazzInterfaces = clazz.getInterfaces(); - interfaces.addAll(Arrays.asList(clazzInterfaces)); - clazz = clazz.getSuperclass(); - } - } - return interfaces.toArray(new Class[0]); - } - -} diff --git a/pom.xml b/pom.xml index 18ac8279..580a28ba 100755 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ UTF-8 1.8 1.8 - 2.7.4 + 2.7.5 0.3.1 5.8.7 3.5.1