ajaxdataType:"json",
让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:空间域名、网页空间、营销软件、网站建设、昂昂溪网站维护、网站推广。
$("#confirmDealDelete").click(function(){
$("#deleteForm").show();
$("#modal-result").hide();
varv_id='${ClientForm.id}';
varv_advancedPassword=$("#advancedPassword").val();
varv_reAdvancedPassword=$("#reAdvancedPassword").val();
if(v_advancedPassword != v_reAdvancedPassword){
$("#modal-result").html("高级密码不一致");
$("#modal-result").show();
return false;
}
marks();
$.ajax({
type:"POST",
url:"/client/deleteClient.json",
dataType:"json",
data: {client: v_id, advancedPassword: v_advancedPassword, reAdvancedPassword: v_reAdvancedPassword},
cache:false,
success:function(result) {
console.log(result.result);
unMarks();
$("#clientList").trigger("reloadGrid");
$("#details").html("");
if(result.result == undefined || result.result==false){
$("#modal-result").html("删除失败");
$("#modal-result").show();
}else{
$("#modal-result").html("删除成功");
$("#modal-result").show();
$("#deleteForm").hide();
}
},
error:function() {
unMarks();
$("#info").attr("class","info-error");
$("#info").html("Sorry,request error");
}
});
});
});
@RequestMapping(value ="/deleteClient.json", method = RequestMethod.POST, produces ="application/json")
@ResponseBody
publicJSONObject deleteClient(@RequestParam(value ="advancedPassword", required =false) String advancedPassword,
@RequestParam(value ="reAdvancedPassword", required =false) String reAdvancedPassword,
@RequestParam(value ="client", required =false)longclientId){
UserAccount userAccount=userAccountService.findUserAccountById(getUserIdBySpring());
JSONObject result=newJSONObject();
if(userAccount !=null&& userAccount.getId() >0&& userAccount.isActivated() && advancedPassword !=null
&& StringUtils.equals(advancedPassword,reAdvancedPassword)){
String md5=Md5Encrypt.md5(advancedPassword);
if(md5 !=null&& StringUtils.equals(md5,userAccount.getAdvancedPassword())){
clientService.deleteClientByUserId(clientId);
result.put("result",true);
}else{
result.put("result",false);
}
}else{
result.put("result",false);
}
returnresult;
}
functiongetAccountDetails(id) {
$.ajax({
type:"GET",
url:"/client/client-details",
data:{id:id},
timeout:50000,
cache:false,
success:function(result) {
$("#details").html(result);
mScroll("details");
unMarks();
} ,
error:function(){
$("#message").html("Request time out");
unMarks();
}
});
}
@RequestMapping(value ="/client-details",method = RequestMethod.GET)
publicString accountDetails(HttpServletRequest request,
ModelMap modelMap,
@RequestParam(value ="id",required =false,defaultValue ="0")longid) {
Client client=clientService.findClientById(id);
ClientForm form =domainToForm(client);
modelMap.addAttribute("ClientForm",form);
return"/client/clientDetail";
}
当前标题:ajaxdataType:"json",
浏览路径:http://scyanting.com/article/gcdsec.html