在决策平台中提供登录后事件的接口,可以在登录成功之后做一些自定义操作。
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.
|
|
|
package com.fr.plugin.decision.login.event;
|
|
|
|
|
|
|
|
import com.fr.decision.fun.impl.AbstractLoginEventProvider;
|
|
|
|
import com.fr.decision.webservice.login.LoginResultInfo;
|
|
|
|
import com.fr.plugin.transform.FunctionRecorder;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by zhouping on 2018/12/14.
|
|
|
|
*/
|
|
|
|
@FunctionRecorder
|
|
|
|
public class CustomLoginActionEvent extends AbstractLoginEventProvider {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void action(LoginResultInfo result) {
|
|
|
|
boolean loginResult = result.isResult();
|
|
|
|
HttpServletRequest request = result.getRequest();
|
|
|
|
HttpServletResponse response = result.getResponse();
|
|
|
|
if (loginResult) {
|
|
|
|
System.out.println(result.getUsername() + " login success, this is CustomLoginActionEvent.");
|
|
|
|
} else {
|
|
|
|
System.out.println("login failed, this is CustomLoginActionEvent.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|