Skip to content

Commit

Permalink
全局异常处理改为rest模式,感谢群友@%%%🤪 发现的bug,@为什么我还是学渣 给出的解决方案
Browse files Browse the repository at this point in the history
  • Loading branch information
click33 committed Oct 13, 2020
1 parent a6c76bd commit 777feb3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import cn.dev33.satoken.exception.NotLoginException;
import cn.dev33.satoken.exception.NotPermissionException;

/**
* 全局异常处理
*/
@ControllerAdvice // 可指定包前缀,比如:(basePackages = "com.pj.admin")
@RestControllerAdvice // 可指定包前缀,比如:(basePackages = "com.pj.admin")
public class GlobalException {

// 在每个控制器之前触发的操作
Expand Down

0 comments on commit 777feb3

Please sign in to comment.