加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

后台多个校验前台ajax接收

发布时间:2020-12-16 02:03:43 所属栏目:百科 来源:网络整理
导读:?? 后台代码: public void doNotNeedSessionAndSecurity_checkshopInfo() throws IOException { String msg = null; String shopInfoId = request.getParameter("lifeshopInfoId"); shopInfo = shopInfoService.getShopInfoById(shopInfoId); if (shopInfo
??
后台代码:
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");
}
}
}
});
}
};

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读