wfSubmitCheckAjax.jsp
2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<%@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);
}
%>