2 changed files with 14 additions and 7 deletions
@ -1,20 +1,27 @@ |
|||||||
package com.fr.plugin.decision.login.event; |
package com.fr.plugin.decision.login.event; |
||||||
|
|
||||||
import com.fr.decision.fun.impl.AbstractLoginEventProvider; |
import com.fr.decision.fun.impl.AbstractLoginEventProvider; |
||||||
|
import com.fr.decision.webservice.login.LoginResultInfo; |
||||||
import com.fr.plugin.transform.FunctionRecorder; |
import com.fr.plugin.transform.FunctionRecorder; |
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest; |
||||||
|
import javax.servlet.http.HttpServletResponse; |
||||||
|
|
||||||
/** |
/** |
||||||
* Created by zhouping on 2018/12/14. |
* Created by zhouping on 2018/12/14. |
||||||
*/ |
*/ |
||||||
@FunctionRecorder |
@FunctionRecorder |
||||||
public class CustomLoginActionEvent extends AbstractLoginEventProvider { |
public class CustomLoginActionEvent extends AbstractLoginEventProvider { |
||||||
|
|
||||||
@Override |
@Override |
||||||
public void after(String userId) { |
public void action(LoginResultInfo result) { |
||||||
try { |
boolean loginResult = result.isResult(); |
||||||
Thread.sleep(10*1000); |
HttpServletRequest request = result.getRequest(); |
||||||
} catch (InterruptedException e) { |
HttpServletResponse response = result.getResponse(); |
||||||
e.printStackTrace(); |
if (loginResult) { |
||||||
|
System.out.println(result.getUsername() + " login success, this is CustomLoginActionEvent."); |
||||||
|
} else { |
||||||
|
System.out.println("login failed, this is CustomLoginActionEvent."); |
||||||
} |
} |
||||||
System.out.println(userId + " login success, this is CustomLoginActionEvent."); |
|
||||||
} |
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue