You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.4 KiB

2 years ago
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<String, String> params = new HashMap<>();
Map<String, String> 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));
}
}