From bcdf270bb0ee9f104fe1e2599d28c492f27abae0 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 8 Dec 2020 19:34:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E6=98=BE=E6=95=B0=E6=8D=AE=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E9=98=B2=E6=AD=A2=E7=A9=BA=E5=80=BC=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/system/controller/SysDictDataController.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysDictDataController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysDictDataController.java index e1b7f32..53acf3c 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysDictDataController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysDictDataController.java @@ -1,6 +1,7 @@ package com.ruoyi.system.controller; import java.io.IOException; +import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; @@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.core.utils.SecurityUtils; +import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.utils.poi.ExcelUtil; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; @@ -75,7 +77,12 @@ public class SysDictDataController extends BaseController @GetMapping(value = "/type/{dictType}") public AjaxResult dictType(@PathVariable String dictType) { - return AjaxResult.success(dictTypeService.selectDictDataByType(dictType)); + List data = dictTypeService.selectDictDataByType(dictType); + if (StringUtils.isNull(data)) + { + data = new ArrayList(); + } + return AjaxResult.success(data); } /**