diff --git a/src/main/java/com/zhiyun/zhiyun03/download/service/impl/DownloadServiceImpl.java b/src/main/java/com/zhiyun/zhiyun03/download/service/impl/DownloadServiceImpl.java index ac64322..2a4a4d6 100644 --- a/src/main/java/com/zhiyun/zhiyun03/download/service/impl/DownloadServiceImpl.java +++ b/src/main/java/com/zhiyun/zhiyun03/download/service/impl/DownloadServiceImpl.java @@ -58,6 +58,10 @@ public class DownloadServiceImpl extends ServiceImpl i * */ @Override public int addDownload(DownloadVo vo) { + if (vo.getDownloadName().isEmpty()) + { + throw new ServiceException("403", "下载名不能为空"); + } //查询下载名称是否已经存在 int count = downloadMapper.selectByName(vo.getDownloadName()); if (count > 0) { diff --git a/src/main/java/com/zhiyun/zhiyun03/invite/service/impl/InviteServieImpl.java b/src/main/java/com/zhiyun/zhiyun03/invite/service/impl/InviteServieImpl.java index 16d6a19..2d29a9e 100644 --- a/src/main/java/com/zhiyun/zhiyun03/invite/service/impl/InviteServieImpl.java +++ b/src/main/java/com/zhiyun/zhiyun03/invite/service/impl/InviteServieImpl.java @@ -79,6 +79,11 @@ public class InviteServieImpl extends ServiceImpl implemen * */ @Override public int addInvite(InviteVo vo) { + /*判断目录名是否为空*/ + if (vo.getInviteName().isEmpty()) + { + throw new ServiceException("400","就业名不能为空"); + } //查询就业名称是否已经存在 int count = inviteMapper.selectByName(vo.getInviteName()); if (count>0) @@ -102,7 +107,7 @@ public class InviteServieImpl extends ServiceImpl implemen return insert; }else { - throw new ServiceException("400","添加下载失败"); + throw new ServiceException("400","添加就业失败"); } } diff --git a/src/main/java/com/zhiyun/zhiyun03/serve/service/impl/ServeServiceImpl.java b/src/main/java/com/zhiyun/zhiyun03/serve/service/impl/ServeServiceImpl.java index a46ced8..bc26748 100644 --- a/src/main/java/com/zhiyun/zhiyun03/serve/service/impl/ServeServiceImpl.java +++ b/src/main/java/com/zhiyun/zhiyun03/serve/service/impl/ServeServiceImpl.java @@ -65,6 +65,10 @@ public class ServeServiceImpl extends ServiceImpl implements * */ @Override public int addServe(ServeVo vo) { + if (vo.getServeName().isEmpty()) + { + throw new ServiceException("403","服务名不能为空"); + } //查询就业名称是否已经存在 int count = serveMapper.selectByName(vo.getServeName()); if (count>0) @@ -89,7 +93,7 @@ public class ServeServiceImpl extends ServiceImpl implements return insert; }else { - throw new ServiceException("400","添加下载失败"); + throw new ServiceException("400","添加服务失败"); } } /* diff --git a/src/main/resources/templates/layui-v2.6.8/downloadList.html b/src/main/resources/templates/layui-v2.6.8/downloadList.html index 79befad..288b1fd 100644 --- a/src/main/resources/templates/layui-v2.6.8/downloadList.html +++ b/src/main/resources/templates/layui-v2.6.8/downloadList.html @@ -447,11 +447,11 @@ $.post("http://localhost:8080/download/addDownload", $("#addDownload").serialize(), function (data) { if ("success" == data.msg) { - layer.msg(data.msg); - $(".layui-laypage-btn").click(); - parent.layer.close(index); + layer.msg(data.msg) + $(".layui-laypage-btn").click() + parent.layer.close(index) } else { - layer.msg(data.msg); + layer.msg(data.msg) } }); } diff --git a/src/main/resources/templates/layui-v2.6.8/index.html b/src/main/resources/templates/layui-v2.6.8/index.html index 10d43f9..4f275bd 100644 --- a/src/main/resources/templates/layui-v2.6.8/index.html +++ b/src/main/resources/templates/layui-v2.6.8/index.html @@ -48,8 +48,6 @@
- -
内容主体区域。记得修改 layui.css 和 js 的路径