JSD-9636 决策平台样式调整
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.

38 lines
1.2 KiB

package com.fr.plugin;
import com.fr.base.TemplateUtils;
import com.fr.gen.TextGenerator;
import com.fr.plugin.context.PluginContexts;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;
public class CustomHeaderHeightJS implements TextGenerator {
public String text(HttpServletRequest req, HttpServletResponse res) throws Exception {
Map<String, Object> renderMap = new HashMap();
CustomHeaderHeightConfig instance = CustomHeaderHeightConfig.getInstance();
Integer height = instance.getCustomHeight();
renderMap.put("height", height);
if (PluginContexts.currentContext().isAvailable()) {
// 做认证通过的事情
return TemplateUtils.renderTemplate(this.template(), renderMap);
} else {
// 做认证未通过的事情
return TemplateUtils.renderTemplate("/com/fr/plugin/scanBuy.tpl", renderMap);
}
}
public String mimeType() {
return "text/javascript";
}
public String template() {
return "/com/fr/plugin/web/customHeightweb.js";
}
}