add jquery para filter and id interceptor
parent
4c7510ae60
commit
35edf90002
2
pom.xml
2
pom.xml
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<groupId>cn.cloudowr</groupId>
|
<groupId>cn.cloudowr</groupId>
|
||||||
<artifactId>sdk</artifactId>
|
<artifactId>sdk</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.1.0</version>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package cn.cloudowr.sdk;
|
||||||
|
|
||||||
|
import com.jfinal.aop.Interceptor;
|
||||||
|
import com.jfinal.aop.Invocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lyf66 on 2017/2/16.
|
||||||
|
*/
|
||||||
|
public class IdInterceptor implements Interceptor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void intercept(Invocation inv) {
|
||||||
|
String id = inv.getController().getPara("id");
|
||||||
|
if (id != null && !id.isEmpty()) {
|
||||||
|
inv.invoke();
|
||||||
|
} else {
|
||||||
|
inv.getController().renderError(400);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package cn.cloudowr.sdk;
|
||||||
|
|
||||||
|
import com.jfinal.aop.Interceptor;
|
||||||
|
import com.jfinal.aop.Invocation;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lyf66 on 2017/2/19.
|
||||||
|
*/
|
||||||
|
public class JQueryParameterFilter implements Interceptor{
|
||||||
|
@Override
|
||||||
|
public void intercept(Invocation inv) {
|
||||||
|
Map<String, String[]> paraMap = inv.getController().getParaMap();
|
||||||
|
paraMap.remove("_");
|
||||||
|
inv.invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue