package com.fr.plugin.oauth.utils; import com.fr.web.utils.WebUtils; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.HashMap; public class HtmlUtils { public static void sendRedirect(String userName,String url, HttpServletResponse httpServletResponse) { HashMap hashMap = new HashMap(); hashMap.put("loginUser", userName); hashMap.put("callBack", url); try { WebUtils.writeOutTemplate("/com/fr/plugin/oauth/web/redirect.html", httpServletResponse, hashMap); } catch (IOException e) { e.printStackTrace(); } } public static void sendRedirect(String userName,String url, String token, HttpServletResponse httpServletResponse, String html) { HashMap hashMap = new HashMap(); hashMap.put("loginUser", userName); hashMap.put("callBack", url); hashMap.put("accessToken", token); try { WebUtils.writeOutTemplate(html, httpServletResponse, hashMap); } catch (IOException e) { e.printStackTrace(); } } }