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.
40 lines
1.4 KiB
40 lines
1.4 KiB
3 years ago
|
package com.fr.plugin.yt;
|
||
|
|
||
|
import com.fr.base.ServerConfig;
|
||
|
import com.fr.base.TemplateUtils;
|
||
|
import com.fr.gen.TextGenerator;
|
||
|
import com.fr.plugin.config.YituanPri;
|
||
|
|
||
|
import javax.servlet.http.HttpServletRequest;
|
||
|
import javax.servlet.http.HttpServletResponse;
|
||
|
import java.net.URLEncoder;
|
||
|
import java.util.HashMap;
|
||
|
import java.util.Map;
|
||
|
|
||
|
public class LoginJS implements TextGenerator {
|
||
|
|
||
|
|
||
|
public String text(HttpServletRequest req, HttpServletResponse res) throws Exception {
|
||
|
Map<String, Object> renderMap = new HashMap();
|
||
|
YituanPri instance = YituanPri.getInstance();
|
||
|
String appid = instance.getScanId();
|
||
|
String servletName = ServerConfig.getInstance().getServletName();
|
||
|
String url = instance.getUrl() + servletName;
|
||
|
url += "/file?path=/com/fr/plugin/web/css/login.css";
|
||
|
String ret = URLEncoder.encode(instance.getUrl() + servletName + "/plugin/public/com.fr.plugin.yituan/yt/scan_login", "UTF-8");
|
||
|
renderMap.put("url", URLEncoder.encode(url, "UTF-8"));
|
||
|
renderMap.put("appId", appid);
|
||
|
renderMap.put("redirect_url", ret);
|
||
|
renderMap.put("cloud_url", instance.getCloudHost());
|
||
|
return TemplateUtils.renderTemplate(this.template(), renderMap);
|
||
|
}
|
||
|
|
||
|
public String mimeType() {
|
||
|
return "text/javascript";
|
||
|
}
|
||
|
|
||
|
public String template() {
|
||
|
return "/com/fr/plugin/web/js/qr.tpl";
|
||
|
}
|
||
|
}
|