mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-29 08:05:04 +08:00
no message
This commit is contained in:
@@ -19,7 +19,6 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -33,8 +32,6 @@ import java.util.Set;
|
|||||||
@WebServlet(name = "APIRouter", urlPatterns = "/api/*", loadOnStartup = 11)
|
@WebServlet(name = "APIRouter", urlPatterns = "/api/*", loadOnStartup = 11)
|
||||||
public class APIRouter extends HttpServlet {
|
public class APIRouter extends HttpServlet {
|
||||||
|
|
||||||
public static final String PROJECT_PATH = "WechatTicketSystem/";
|
|
||||||
|
|
||||||
protected static Gson gson = SQLCore.gson;
|
protected static Gson gson = SQLCore.gson;
|
||||||
private Map<String, API> nodes = new HashMap<>();
|
private Map<String, API> nodes = new HashMap<>();
|
||||||
|
|
||||||
@@ -69,14 +66,9 @@ public class APIRouter extends HttpServlet {
|
|||||||
resp.addHeader("Access-Control-Allow-Origin", "*");
|
resp.addHeader("Access-Control-Allow-Origin", "*");
|
||||||
Object obj = null;
|
Object obj = null;
|
||||||
try {
|
try {
|
||||||
API api = nodes.get(req.getRequestURI().substring(PROJECT_PATH.length()));
|
API api = nodes.get(req.getPathInfo());
|
||||||
if (api == null) {
|
if (api == null) {
|
||||||
// resp.sendError(HttpServletResponse.SC_FORBIDDEN);
|
resp.sendError(HttpServletResponse.SC_FORBIDDEN);
|
||||||
obj = Arrays.asList(
|
|
||||||
req.getContextPath(),
|
|
||||||
req.getPathInfo(),
|
|
||||||
req.getPathTranslated(),
|
|
||||||
req.getServletPath());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
WxSession session = getSession(req);
|
WxSession session = getSession(req);
|
||||||
|
|||||||
Reference in New Issue
Block a user