500错误统一改为服务升级中

This commit is contained in:
沈健
2024-12-27 16:09:03 +08:00
parent ce9497e328
commit 140470bbc5
2 changed files with 2 additions and 2 deletions
@@ -35,7 +35,7 @@ public class FangjiaOpenExceptionHandler implements ExceptionHandler {
context.getResponse().setStatus(500); context.getResponse().setStatus(500);
context.getResponse().setCharacterEncoding("UTF-8"); context.getResponse().setCharacterEncoding("UTF-8");
context.getResponse().setContentType("application/json;charset=UTF-8"); context.getResponse().setContentType("application/json;charset=UTF-8");
context.getResponse().getWriter().println("{\"code\":500, \"msg\":\"服务器内部错误\"}"); context.getResponse().getWriter().println("{\"code\":500, \"msg\":\"服务升级中...\"}");
} }
public static String getLocalHostIP() { public static String getLocalHostIP() {
@@ -111,7 +111,7 @@ public class AuthenticationInterceptor implements Interceptor {
String ip = getLocalHostIP(); String ip = getLocalHostIP();
String token = "2307d2fec8314b3e8b4b83dd1d42da2e2051638e3e668f21e77ca01258bf682c"; String token = "2307d2fec8314b3e8b4b83dd1d42da2e2051638e3e668f21e77ca01258bf682c";
try { try {
DingDingMessageUtil.sendTextMessage(token, "[OpenApi] "+ip+"服务器内部错误,请及时关注!"); DingDingMessageUtil.sendTextMessage(token, "[OpenApi] "+ip+"Authentication error!");
} catch (Exception e1) { } catch (Exception e1) {
e1.printStackTrace(); e1.printStackTrace();
} }