kaiyu
2020-09-17 613dd76a3aded439f1002d904d85d8332ddb03d1
src/main/java/com/moral/common/exceptionHandler/WebAuthExceptionHandler.java
@@ -6,14 +6,21 @@
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;
/**
* @Description: Web授权异常处理器
        * @Param:
        * @return:
        * @Author: 陈凯裕
        * @Date: 2020/9/16
        */
@RestControllerAdvice
public class WebAuthExceptionHandler {
    @ExceptionHandler(WebAuthException.class)
    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
    public Map<String,Object> handlerWebAuthException(WebAuthException e){
    public Map<String,Object> handlerWebAuthException(WebAuthException e, HttpServletResponse response){
        Map<String,Object> result = new HashMap<>();
        result.put("msg",e.getMessage());
        result.put("accountId", -1);