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
## 3.1.3
- 修复监控日志乱码问题
## 3.1.2
- 修复图片上传保存后图片破损问题

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

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

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

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

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

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

@ -15,7 +15,10 @@ import com.netflix.util.Pair;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;
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.Locale;
import java.util.function.Consumer;
@ -39,11 +42,15 @@ public class ZuulResultExecutor extends BaseExecutorAdapter<RequestContext, Stri
@Override
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) {
requestContext.getZuulResponseHeaders().remove(index);
}
});
if (StringUtils.hasText(errorMsg)) {
errorMsg = UriUtils.decode(errorMsg, StandardCharsets.UTF_8);
}
return errorMsg;
}
@Override

@ -6,11 +6,11 @@
<parent>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-common</artifactId>
<version>3.1.2-SNAPSHOT</version>
<version>3.1.3-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>sop-service-common</artifactId>
<version>3.1.2-SNAPSHOT</version>
<version>3.1.3-SNAPSHOT</version>
<packaging>jar</packaging>
<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.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.util.UriUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.nio.charset.StandardCharsets;
/**
* 全局异常处理
@ -75,7 +77,7 @@ public class GlobalExceptionHandler {
StackTraceElement stackTraceElement = stackTrace[i];
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("系统繁忙"));
}

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

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

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

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

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

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

Loading…
Cancel
Save