mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-09-21 02:57:56 +08:00
27 lines
720 B
Java
27 lines
720 B
Java
![]() |
package com.pj.current;
|
||
|
|
||
|
import java.io.IOException;
|
||
|
|
||
|
import org.springframework.boot.web.servlet.error.ErrorController;
|
||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
||
|
import cn.dev33.satoken.util.SaResult;
|
||
|
import jakarta.servlet.http.HttpServletRequest;
|
||
|
import jakarta.servlet.http.HttpServletResponse;
|
||
|
|
||
|
/**
|
||
|
* 处理 404
|
||
|
* @author kong
|
||
|
*/
|
||
|
@RestController
|
||
|
public class NotFoundHandle implements ErrorController {
|
||
|
|
||
|
@RequestMapping("/error")
|
||
|
public Object error(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||
|
response.setStatus(200);
|
||
|
return SaResult.get(404, "not found", null);
|
||
|
}
|
||
|
|
||
|
}
|