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.
48 lines
1.7 KiB
48 lines
1.7 KiB
4 years ago
|
package com.fr.plugin;
|
||
|
|
||
|
import com.fr.base.ServerConfig;
|
||
|
import com.fr.base.TemplateUtils;
|
||
|
import com.fr.log.FineLoggerFactory;
|
||
|
import com.fr.plugin.context.PluginContext;
|
||
|
import com.fr.plugin.context.PluginContexts;
|
||
|
import com.fr.plugin.mobile.web.server.config.Html5Config;
|
||
|
import com.fr.plugin.observer.inner.AbstractPluginLifecycleMonitor;
|
||
|
import com.fr.plugin.transform.ExecuteFunctionRecord;
|
||
|
import com.fr.plugin.transform.FunctionRecorder;
|
||
|
import com.fr.stable.StringUtils;
|
||
|
import com.fr.stable.fun.Authorize;
|
||
|
|
||
|
@FunctionRecorder
|
||
|
@Authorize(callSignKey = "com.fr.plugin.qywxyccd")
|
||
|
public class YCCDMonitor extends AbstractPluginLifecycleMonitor {
|
||
|
@Override
|
||
|
@ExecuteFunctionRecord
|
||
|
public void afterRun(PluginContext pluginContext) {
|
||
|
|
||
|
Html5Config html5Config = Html5Config.getInstance();
|
||
|
String jsLink = html5Config.getJsLink();
|
||
|
if (PluginContexts.currentContext().isAvailable()) {
|
||
|
// 做认证通过的事情
|
||
|
if (!StringUtils.contains(jsLink, "hidemenu.js")) {
|
||
|
String url = null;
|
||
|
ServerConfig serverConfig = ServerConfig.getInstance();
|
||
|
String reportServletName = serverConfig.getServletName();
|
||
|
try {
|
||
|
url = "/"+reportServletName+"/file?path=com/fr/plugin/hidemenu.js&type=plain&parser=plain" ;
|
||
|
html5Config.setjsLink(jsLink +";\n"+ url);
|
||
|
} catch (Exception e) {
|
||
|
e.printStackTrace();
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
// 做认证未通过的事情
|
||
|
FineLoggerFactory.getLogger().error("企业微信隐藏菜单 插件未注册");
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void beforeStop(PluginContext pluginContext) {
|
||
|
|
||
|
}
|
||
|
}
|