From 697be9824abd9cc4e0ab073c8a258abd981c1220 Mon Sep 17 00:00:00 2001 From: whb <17803890193@163.com> Date: Mon, 14 Aug 2023 07:05:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=AE=A1=E7=90=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zhiyun03/utils/common/JsonResult.java | 2 +- src/main/resources/application.yml | 2 +- .../templates/layui-v2.6.8/courseList.html | 20 ++- .../templates/layui-v2.6.8/downloadList.html | 20 ++- .../templates/layui-v2.6.8/index.html | 43 +++-- .../templates/layui-v2.6.8/inviteList.html | 33 +++- .../templates/layui-v2.6.8/serveList.html | 27 ++-- .../templates/layui-v2.6.8/test.html | 150 ------------------ 8 files changed, 86 insertions(+), 211 deletions(-) delete mode 100644 src/main/resources/templates/layui-v2.6.8/test.html diff --git a/src/main/java/com/zhiyun/zhiyun03/utils/common/JsonResult.java b/src/main/java/com/zhiyun/zhiyun03/utils/common/JsonResult.java index 047d4a7..78afc7a 100644 --- a/src/main/java/com/zhiyun/zhiyun03/utils/common/JsonResult.java +++ b/src/main/java/com/zhiyun/zhiyun03/utils/common/JsonResult.java @@ -13,7 +13,7 @@ public class JsonResult { private String msg; private long count; private T data; - private Long count; + public static JsonResult success() { diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 1b85afd..9225c66 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -19,7 +19,7 @@ spring: druid: url: jdbc:mysql://localhost:3306/zhiyun?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai username: root - password: 123456 + password: root diff --git a/src/main/resources/templates/layui-v2.6.8/courseList.html b/src/main/resources/templates/layui-v2.6.8/courseList.html index f58ca0b..21c31b4 100644 --- a/src/main/resources/templates/layui-v2.6.8/courseList.html +++ b/src/main/resources/templates/layui-v2.6.8/courseList.html @@ -98,13 +98,18 @@ //获取要删除的服务的id var deleteCourseId = data.id; - //发送Ajax到后台,进行删除操作 - $.get("http://localhost:8080/api/course/delCourseById", { "id": deleteCourseId}, - function(data){ - if("success" == data.msg){ - location.reload();//重新加载当前页面 - } - }); + $.get("http://localhost:8080/api/course/delCourseById",{ "id": deleteCourseId},function (result) { + if (result.code==200){ + // 删除成功之后 弹出msg + layer.msg(result.msg); + // 重点:继续显示当前页 + $(".layui-laypage-btn").click(); + } else { + layer.msg(result.msg, {icon: 2}); + layer.close(index); + } + }); + }); } else if(obj.event === 'edit'){ // layer.prompt({ @@ -116,7 +121,6 @@ // }); // layer.close(index); // }); - //layer.alert(JSON.stringify(data)); selectOne(data); } 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 1b61abf..73a901e 100644 --- a/src/main/resources/templates/layui-v2.6.8/downloadList.html +++ b/src/main/resources/templates/layui-v2.6.8/downloadList.html @@ -98,13 +98,18 @@ //获取要删除的服务的id var deleteDownloadId = data.id; - //发送Ajax到后台,进行删除操作 - $.get("http://localhost:8080/download/delDownload", { "id": deleteDownloadId}, - function(data){ - if("success" == data.msg){ - location.reload();//重新加载当前页面 - } - }); + $.get("http://localhost:8080/download/delDownload",{ "id": deleteDownloadId},function (result) { + if (result.code==200){ + // 删除成功之后 弹出msg + layer.msg(result.msg); + // 重点:继续显示当前页 + $(".layui-laypage-btn").click(); + } else { + layer.msg(result.msg, {icon: 2}); + layer.close(index); + } + }); + }); } else if(obj.event === 'edit'){ // layer.prompt({ @@ -123,6 +128,7 @@ }); + }); 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 a98ae35..29c1d42 100644 --- a/src/main/resources/templates/layui-v2.6.8/index.html +++ b/src/main/resources/templates/layui-v2.6.8/index.html @@ -11,24 +11,24 @@
- + + + + + + + + + + + + +