public void doNotNeedSessionAndSecurity_checkshopInfo() throws IOException {
String msg = null;
String shopInfoId = request.getParameter("lifeshopInfoId");
shopInfo = shopInfoService.getShopInfoById(shopInfoId);
if (shopInfo != null) {
if (shopInfo.getStatus() == 3) {
if (shopInfo.getFreezeStatus() == 1) {
msg = "{\"success\":true}";
} else {
msg = "{\"success\":false,\"msg\":1}";
}
} else {
msg = "{\"success\":false,\"msg\":2}";
}
} else {
msg = "{\"success\":false,\"msg\":3}";
}
response.getWriter().write(msg);
}
}
前台ajax:
function checkshopInfo() {
if($("#lifeshopInfoId").val()!=''){
$.ajax({
type : "post",// 请求方式
url : sys.contextPath + "/lifeCycleShop/ajax_lifeCycleShop/doNotNeedSessionAndSecurity_checkshopInfo",// 发送请求地址
data : {
"lifeshopInfoId" : $("#lifeshopInfoId").val()
},
dataType : "json",
error : function() {
$.messager.alert("提示","连接服务器超时,请稍后重试...","error");
},
success : function(result) {
if (!result.success) {
if (result.msg == 1) {
$.messager.alert("提示","该服务机构关联的店铺已被冻结!","error");
} else if (result.msg == 2) {
$.messager.alert("提示","该服务机构所关联的店铺已被下架!","error");
} else if (result.msg == 3) {
$.messager.alert("提示","该服务机构不存在!","error");
}
}
}
});
}
};
原文链接:https://www.f2er.com/ajax/163583.html