|
|
@@ -4,10 +4,14 @@ import com.tianhu.common.core.domain.R;
|
|
|
import com.tianhu.common.core.exception.RepeatException;
|
|
|
import com.tianhu.common.core.utils.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.ControllerAdvice;
|
|
|
+import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
@ControllerAdvice
|
|
|
public class MyGlobalExceptionHandler {
|
|
|
|
|
|
+ @ExceptionHandler(RepeatException.class)
|
|
|
+ @ResponseBody
|
|
|
public R customException(RepeatException e) {
|
|
|
e.printStackTrace();
|
|
|
if (StringUtils.isEmpty(e.getDefaultMessage())) {
|