function modForm(modifyForm){
var a=$("#userMobilePhoneNo").val();
if(a==""){
a=$("#mobile").val();
}
$.ajax({
dataType:"json",
async:true,
data: "&mobile=" + a+"&second=2",
url: "${pageContext.request.contextPath}/fastpay/sms.htm",
type:"POST",
error:function(){
alert("验证码发送失败,一分钟内只能获取一次");
return ;
},
success: function(result){
document.getElementById('warnlog').style.display="inline";
$("#mobile").val(a);
$("#getit1").hide();
$(".spec_tr1").show();
$("#warnlog").html("短信验证码已经发送,有效期一分钟");
$("#warnlog").attr("class","warnlog");
$("#warnlog").show();
$("#checkCodeNum").html(result.checkCodeNum);
return ;
}
});
}
后台代码:
protected ModelAndView handle(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors)
throws Exception {
BatchAuditMerAccessVO bama = (BatchAuditMerAccessVO) command;
operationLog(request, command);
if (errors.hasErrors()) {
log.error("风控批量审核错误,表单验证不正常");
return null;
}
JSONObject jsonObj = new JSONObject();
jsonObj.put(BATCH_AUDITED_ID_LIST_DATA, auditedIdList);
jsonObj.put(AUDIT_RESULT_DATA, auditResult);
request.setCharacterEncoding("UTF-8");
response.setHeader("Cache-Control", "no-cache");
response.setContentType("text/json;charset=UTF-8");
PrintWriter pw = response.getWriter();
pw.write(jsonObj.toString());
pw.flush();
pw.close();
return null;
}