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; });