Merge branch 'master' into taobao_model

taobao_model
tanghc 5 years ago
commit cb0930a368
  1. 4
      changelog.md
  2. 2
      sop-auth/pom.xml
  3. 2
      sop-common/pom.xml
  4. 6
      sop-common/sop-bridge-gateway/pom.xml
  5. 6
      sop-common/sop-bridge-zuul/pom.xml
  6. 4
      sop-common/sop-gateway-common/pom.xml
  7. 6
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java
  8. 9
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/result/ZuulResultExecutor.java
  9. 4
      sop-common/sop-service-common/pom.xml
  10. 4
      sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/GlobalExceptionHandler.java
  11. 2
      sop-example/sop-book/sop-book-web/pom.xml
  12. 2
      sop-example/sop-easyopen/pom.xml
  13. 2
      sop-example/sop-springmvc/pom.xml
  14. 2
      sop-example/sop-story/sop-story-web/pom.xml
  15. 2
      sop-gateway/pom.xml
  16. 2
      sop-website/pom.xml

@ -1,5 +1,9 @@
# changelog # changelog
## 3.1.3
- 修复监控日志乱码问题
## 3.1.2 ## 3.1.2
- 修复图片上传保存后图片破损问题 - 修复图片上传保存后图片破损问题

@ -26,7 +26,7 @@
<dependency> <dependency>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId> <artifactId>sop-service-common</artifactId>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
</dependency> </dependency>
<!-- sop相关配置 end--> <!-- sop相关配置 end-->

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-common</artifactId> <artifactId>sop-common</artifactId>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<properties> <properties>

@ -5,11 +5,11 @@
<parent> <parent>
<artifactId>sop-common</artifactId> <artifactId>sop-common</artifactId>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
<artifactId>sop-bridge-gateway</artifactId> <artifactId>sop-bridge-gateway</artifactId>
@ -17,7 +17,7 @@
<dependency> <dependency>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-gateway-common</artifactId> <artifactId>sop-gateway-common</artifactId>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>

@ -5,11 +5,11 @@
<parent> <parent>
<artifactId>sop-common</artifactId> <artifactId>sop-common</artifactId>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
<artifactId>sop-bridge-zuul</artifactId> <artifactId>sop-bridge-zuul</artifactId>
@ -17,7 +17,7 @@
<dependency> <dependency>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-gateway-common</artifactId> <artifactId>sop-gateway-common</artifactId>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>

@ -5,11 +5,11 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-common</artifactId> <artifactId>sop-common</artifactId>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>sop-gateway-common</artifactId> <artifactId>sop-gateway-common</artifactId>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>sop-gateway-common</name> <name>sop-gateway-common</name>

@ -14,8 +14,11 @@ import com.gitee.sop.gatewaycommon.result.ResultExecutorForGateway;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.server.ServerWebExchange; import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.util.UriUtils;
import java.nio.charset.StandardCharsets;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
@ -46,6 +49,9 @@ public class GatewayResultExecutor extends BaseExecutorAdapter<ServerWebExchange
if (!CollectionUtils.isEmpty(errorMessageList)) { if (!CollectionUtils.isEmpty(errorMessageList)) {
errorMsg = errorMessageList.get(0); errorMsg = errorMessageList.get(0);
} }
if (StringUtils.hasText(errorMsg)) {
errorMsg = UriUtils.decode(errorMsg, StandardCharsets.UTF_8);
}
exchange.getResponse().getHeaders().remove(SopConstants.X_SERVICE_ERROR_MESSAGE); exchange.getResponse().getHeaders().remove(SopConstants.X_SERVICE_ERROR_MESSAGE);
return errorMsg; return errorMsg;
} }

@ -15,7 +15,10 @@ import com.netflix.util.Pair;
import com.netflix.zuul.context.RequestContext; import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException; import com.netflix.zuul.exception.ZuulException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;
import org.springframework.web.util.UriUtils;
import java.nio.charset.StandardCharsets;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.function.Consumer; import java.util.function.Consumer;
@ -39,11 +42,15 @@ public class ZuulResultExecutor extends BaseExecutorAdapter<RequestContext, Stri
@Override @Override
public String getResponseErrorMessage(RequestContext requestContext) { public String getResponseErrorMessage(RequestContext requestContext) {
return getHeader(requestContext, SopConstants.X_SERVICE_ERROR_MESSAGE, (index)->{ String errorMsg = getHeader(requestContext, SopConstants.X_SERVICE_ERROR_MESSAGE, (index)->{
if (index > -1) { if (index > -1) {
requestContext.getZuulResponseHeaders().remove(index); requestContext.getZuulResponseHeaders().remove(index);
} }
}); });
if (StringUtils.hasText(errorMsg)) {
errorMsg = UriUtils.decode(errorMsg, StandardCharsets.UTF_8);
}
return errorMsg;
} }
@Override @Override

@ -6,11 +6,11 @@
<parent> <parent>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-common</artifactId> <artifactId>sop-common</artifactId>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>sop-service-common</artifactId> <artifactId>sop-service-common</artifactId>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>sop-service-common</name> <name>sop-service-common</name>

@ -9,9 +9,11 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.util.UriUtils;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.nio.charset.StandardCharsets;
/** /**
* 全局异常处理 * 全局异常处理
@ -75,7 +77,7 @@ public class GlobalExceptionHandler {
StackTraceElement stackTraceElement = stackTrace[i]; StackTraceElement stackTraceElement = stackTrace[i];
msg.append("<br> at ").append(stackTraceElement.toString()); msg.append("<br> at ").append(stackTraceElement.toString());
} }
response.setHeader("x-service-error-message", msg.toString()); response.setHeader("x-service-error-message", UriUtils.encode(msg.toString(), StandardCharsets.UTF_8));
return this.processError(request, response, new ServiceException("系统繁忙")); return this.processError(request, response, new ServiceException("系统繁忙"));
} }

@ -28,7 +28,7 @@
<dependency> <dependency>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId> <artifactId>sop-service-common</artifactId>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>

@ -29,7 +29,7 @@
<dependency> <dependency>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId> <artifactId>sop-service-common</artifactId>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
</dependency> </dependency>
<!-- 使用nacos注册中心 <!-- 使用nacos注册中心

@ -20,7 +20,7 @@
<dependency> <dependency>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId> <artifactId>sop-service-common</artifactId>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
</dependency> </dependency>
<!-- nacos --> <!-- nacos -->
<dependency> <dependency>

@ -28,7 +28,7 @@
<dependency> <dependency>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId> <artifactId>sop-service-common</artifactId>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>

@ -34,7 +34,7 @@
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-bridge-gateway</artifactId> <artifactId>sop-bridge-gateway</artifactId>
<!--<artifactId>sop-bridge-zuul</artifactId>--> <!--<artifactId>sop-bridge-zuul</artifactId>-->
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>

@ -35,7 +35,7 @@
<dependency> <dependency>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-gateway-common</artifactId> <artifactId>sop-gateway-common</artifactId>
<version>3.1.2-SNAPSHOT</version> <version>3.1.3-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>

Loading…
Cancel
Save