From f466bb840ded77ff28310ed6679595b53059c37e Mon Sep 17 00:00:00 2001 From: dshclm <3321914460@qq.com> Date: Wed, 14 Aug 2024 14:38:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=BA=E6=89=80=E5=87=BA=E5=85=A5=E7=99=BB?= =?UTF-8?q?=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/place/TdPlaceController.java | 13 +++---------- .../templates/system/placeRegist/placeRegist.html | 1 - 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/place/TdPlaceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/place/TdPlaceController.java index 09f977d..4087d94 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/place/TdPlaceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/place/TdPlaceController.java @@ -122,20 +122,13 @@ public class TdPlaceController extends BaseController { * 查询所有场所 * @return com.ruoyi.common.core.domain.AjaxResult */ -// @PostMapping("/getList") -// @ResponseBody -// public AjaxResult getList() { -// return AjaxResult.success(placeManager.selectList()); -// } @PostMapping("/getList") @ResponseBody - public AjaxResult getList(@RequestParam(value = "id", required = false) Long id) { - if (id == null) { - // 如果 id 为空,则查询所有数据 + public AjaxResult getList(@RequestParam(value = "placeId", required = false) Long placeId) { + if (placeId == null) { return AjaxResult.success(placeManager.selectList()); } else { - // 否则,根据 id 查询单条数据 - TdPlace place = placeManager.selectById(id); + TdPlace place = placeManager.selectById(placeId); if (place != null) { return AjaxResult.success(place); } else { diff --git a/ruoyi-admin/src/main/resources/templates/system/placeRegist/placeRegist.html b/ruoyi-admin/src/main/resources/templates/system/placeRegist/placeRegist.html index d512298..f1fe74e 100644 --- a/ruoyi-admin/src/main/resources/templates/system/placeRegist/placeRegist.html +++ b/ruoyi-admin/src/main/resources/templates/system/placeRegist/placeRegist.html @@ -55,7 +55,6 @@ method: 'POST', dataType: 'json' }).done(function(data) { - // 假设返回的数据格式为 { data: [{ id: 1, placeName: '...'}, ...] } data.data.forEach(function(item) { placeCache[item.id] = item.placeName; });