commit d0b3227198c4eb41371a1b1ddbdd5c9cf349960e Author: Zed Date: Mon Apr 8 21:26:25 2019 +0800 DEC-5893 提供一个demo diff --git a/build.xml b/build.xml new file mode 100755 index 0000000..2ffcea8 --- /dev/null +++ b/build.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/install/fr-plugin-H5-request-preHandle-1.0.zip b/install/fr-plugin-H5-request-preHandle-1.0.zip new file mode 100644 index 0000000..14ff59f Binary files /dev/null and b/install/fr-plugin-H5-request-preHandle-1.0.zip differ diff --git a/plugin.xml b/plugin.xml new file mode 100755 index 0000000..4673931 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,18 @@ + + + com.fr.plugin.passport + + yes + 1.0 + 10.0~ + 2019-04-08 + zed + + + + + + + \ No newline at end of file diff --git a/prehandle.iml b/prehandle.iml new file mode 100644 index 0000000..78844c7 --- /dev/null +++ b/prehandle.iml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/decision/MobileH5RequestPreHandle.java b/src/main/java/com/fr/plugin/decision/MobileH5RequestPreHandle.java new file mode 100644 index 0000000..6d50341 --- /dev/null +++ b/src/main/java/com/fr/plugin/decision/MobileH5RequestPreHandle.java @@ -0,0 +1,27 @@ +package com.fr.plugin.decision; + +import com.fr.decision.fun.impl.AbstractRequestPreHandleProvider; +import com.fr.plugin.transform.FunctionRecorder; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Created by Zed on 2019/4/8. + */ +@FunctionRecorder +public class MobileH5RequestPreHandle extends AbstractRequestPreHandleProvider { + + @Override + public boolean accept(HttpServletRequest req) { + return true; + } + + @Override + public void preHandle(HttpServletRequest req, HttpServletResponse res) { + try { + res.sendRedirect("https://git.fanruan.com"); + } catch (Exception ignore) { + } + } +}