lyhzzz пре 1 недеља
родитељ
комит
86b36df0c3

+ 1 - 2
src/main/java/com/fdkankan/ucenter/controller/SceneApplyController.java

@@ -36,8 +36,7 @@ public class SceneApplyController {
     @PostMapping("/save")
     @PostMapping("/save")
     public ResultData save(@RequestBody SceneApply param){
     public ResultData save(@RequestBody SceneApply param){
         if(StringUtils.isEmpty(param.getName()) || StringUtils.isEmpty(param.getPhone())
         if(StringUtils.isEmpty(param.getName()) || StringUtils.isEmpty(param.getPhone())
-         || StringUtils.isEmpty(param.getCompany()) || StringUtils.isEmpty(param.getJob())
-        || StringUtils.isEmpty(param.getCountry())){
+         || StringUtils.isEmpty(param.getCompany()) || StringUtils.isEmpty(param.getEmail())){
             throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
             throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
         }
         }
         if(param.getName().length() >50 || param.getCompany().length() >200){
         if(param.getName().length() >50 || param.getCompany().length() >200){

+ 10 - 0
src/main/java/com/fdkankan/ucenter/exception/GlobalExceptionHandler.java

@@ -3,8 +3,11 @@ package com.fdkankan.ucenter.exception;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.ucenter.common.Result;
 import com.fdkankan.ucenter.common.Result;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.catalina.connector.ClientAbortException;
+import org.springframework.http.HttpStatus;
 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.bind.annotation.ResponseStatus;
 import org.springframework.web.bind.annotation.RestControllerAdvice;
 import org.springframework.web.bind.annotation.RestControllerAdvice;
 
 
 /**
 /**
@@ -41,4 +44,11 @@ public class GlobalExceptionHandler {
     public Result businessExceptionHandler2(com.fdkankan.ucenter.exception.BusinessException e) {
     public Result businessExceptionHandler2(com.fdkankan.ucenter.exception.BusinessException e) {
         return Result.failure(e.getCode(), e.getMessage());
         return Result.failure(e.getCode(), e.getMessage());
     }
     }
+
+    @ResponseBody
+    @ExceptionHandler(ClientAbortException.class)
+    public Result handleClientAbortException(ClientAbortException e) {
+        log.warn("客户端提前断开连接: {}", e.getMessage());
+        return Result.failure(200, "");
+    }
 }
 }