wfSubmitCheckAjax.jsp 2.52 KB
<%@page import="weaver.hrm.User"%>
<%@page import="weaver.hrm.HrmUserVarify"%>
<%@page import="com.engine.common.util.*"%>
<%@page import="com.engine.workflow.service.RequestSecondAuthService"%>
<%@page import="com.engine.workflow.service.impl.RequestSecondAuthServiceImpl"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.*,weaver.conn.*,java.util.*" %>
<%@page import="com.alibaba.fastjson.JSONObject"%>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<%
User user = HrmUserVarify.getUser (request , response) ;
String type = Util.null2String(request.getParameter("type"));

Map<String, Object> params = ParamUtil.request2Map(request);
RequestSecondAuthService service = ServiceUtil.getService(RequestSecondAuthServiceImpl.class, user);

if("needCheck".equals(type)){//校验是否需要校验
	
	/*
	Map<String,String> result = new HashMap<String,String>();
	result.put("isEnableAuth","1");
	result.put("secondAuthType","10");*/
	
	Map<String, Object> result = service.getSecondAuthConfig(params);
	
	String resultStr = JSONObject.toJSONString(result);
	System.out.println("needCheck=====resultStr="+resultStr);
	
	out.print(resultStr);
}else if("checkValue".equals(type)){//校验密码
	
	/*Map<String,String> result = new HashMap<String,String>();
	result.put("api_status","false");
	result.put("api_errormsg","密码已过期,请点击重新发送");*/
	
	Map<String, Object> result = service.doSecondAuth(params);
	
	String resultStr = JSONObject.toJSONString(result);
	System.out.println("checkValue=====resultStr="+resultStr);
	
	out.print(resultStr);
}else if("sendMsg".equals(type)){//发送短信
	
	/*Map<String,String> result = new HashMap<String,String>();
	result.put("api_status","true");
	result.put("api_errormsg","发送短信失败,请点击重新发送");
	result.put("validSecond","60");*/
	Map<String, Object> result = new HashMap<String ,Object>();
	try{
		result = service.getDynamicPassword(params);
	}catch(Exception e){
		result.put("api_status",true);
		result.put("api_errormsg","发送短信失败,请点击重新发送");
		result.put("validSecond","60");
	}
	
	String resultStr = JSONObject.toJSONString(result);
	System.out.println("sendMsg====resultStr="+resultStr);
	
	out.print(resultStr);
}else if("checkProtectDatas".equals(type)){		//验证数据
	Map<String, Object> result = service.checkProtectDatas(params);

	String resultStr = JSONObject.toJSONString(result);
	System.out.println("checkProtectDatas=====resultStr="+resultStr);

	out.print(resultStr);
}
%>