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.
33 lines
1.1 KiB
33 lines
1.1 KiB
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(); |
|
} |
|
} |
|
|
|
}
|
|
|