mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 09:35:29 +08:00
24 lines
473 B
Java
24 lines
473 B
Java
package com.pj.config;
|
|
|
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|
|
|
import cn.dev33.satoken.util.SaResult;
|
|
|
|
/**
|
|
* 全局异常处理
|
|
* @author click33
|
|
*
|
|
*/
|
|
@RestControllerAdvice
|
|
public class GlobalExceptionHandler {
|
|
|
|
// 全局异常拦截
|
|
@ExceptionHandler
|
|
public SaResult handlerException(Exception e) {
|
|
e.printStackTrace();
|
|
return SaResult.error(e.getMessage());
|
|
}
|
|
|
|
}
|