|
|
|
@ -5,9 +5,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.dromara.common.core.domain.R;
|
|
|
|
import org.dromara.common.core.domain.R;
|
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
|
import org.dromara.common.satoken.handler.SaTokenExceptionHandler;
|
|
|
|
|
|
|
|
import org.mybatis.spring.MyBatisSystemException;
|
|
|
|
import org.mybatis.spring.MyBatisSystemException;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.dao.DuplicateKeyException;
|
|
|
|
import org.springframework.dao.DuplicateKeyException;
|
|
|
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
|
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
|
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|
|
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|
|
|
@ -21,9 +19,6 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|
|
|
@RestControllerAdvice
|
|
|
|
@RestControllerAdvice
|
|
|
|
public class MybatisExceptionHandler {
|
|
|
|
public class MybatisExceptionHandler {
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private SaTokenExceptionHandler saTokenExceptionHandler;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 主键或UNIQUE索引,数据重复异常
|
|
|
|
* 主键或UNIQUE索引,数据重复异常
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|