package com.fr.plugin.http.handler; import com.fanruan.api.log.LogKit; import com.fanruan.api.net.http.HttpKit; import com.fr.decision.fun.impl.BaseHttpHandler; import com.fr.json.JSONObject; import com.fr.plugin.LDYConfig; import com.fr.third.springframework.web.bind.annotation.RequestMethod; import com.fr.web.utils.WebUtils; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.HashMap; import java.util.Map; public class ALLLogout1Handler extends BaseHttpHandler { @Override public RequestMethod getMethod() { return null; } @Override public String getPath() { return "/logout"; } @Override public boolean isPublic() { return true; } @Override public void handle(HttpServletRequest req, HttpServletResponse res) throws Exception { String token = WebUtils.getHTTPRequestParameter(req, "token"); LDYConfig config = LDYConfig.getInstance(); String base = config.getApiUrl(); String getUrl = base + "/open/api/exhibition/logout"; Map params = new HashMap<>(); Map header = new HashMap<>(); header.put("Authorization", "Bearer "+token); String json = HttpKit.get(getUrl, params, header); LogKit.info("loginUrl:{} token:{} ALLGetTicket1Handler json:{}",getUrl,header,json); WebUtils.printAsJSON(res, new JSONObject(json)); } }