| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | |
| | | |
| | | /** |
| | | * @author Tanbin |
| | | * @date 2018-12-12 |
| | | */ |
| | | @Component("LoginAction") |
| | | public class LoginAction extends AbstractAction { |
| | | protected Logger logger = LoggerFactory.getLogger(getClass()); |
| | |
| | | private OjdbcProperties ojdbcProperties; |
| | | |
| | | protected ServicesManager servicesManager; |
| | | |
| | | private static String mUserName = "username"; |
| | | @Override |
| | | protected Event doExecute(RequestContext requestContext) throws Exception { |
| | | |
| | |
| | | HttpServletRequest hsr= WebUtils.getHttpServletRequest(); |
| | | |
| | | JSONObject json=portallogin(hsr); |
| | | if(json!=null&&json.containsKey("username")){ |
| | | if(json!=null&&json.containsKey(mUserName)){ |
| | | requestContext.getFlowScope().put("username", json.get("username").toString()); |
| | | } |
| | | String serviceUrl = hsr.getParameter("service"); |
| | |
| | | String querystring=request.getQueryString(); |
| | | String username=""; |
| | | if(querystring!=null){ |
| | | String par[] = querystring.split("&"); |
| | | String[] par = querystring.split("&"); |
| | | for (int i = 0; i < par.length; i++) { |
| | | String a = par[i].split("=")[0]; |
| | | String v = par[i].split("=")[1]; |
| | | if(a.equals("validateNumber")){ |
| | | if("validateNumber".equals(a)){ |
| | | String validateurl="http://192.168.4.50/services/PortalLoginService/ValidLoginUser?validateNumber="+v; |
| | | try { |
| | | result= HttpUtils.get(validateurl); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | if(a.equals("userName")){ |
| | | if("userName".equals(a)){ |
| | | username=v; |
| | | } |
| | | } |