diff --git a/manager-api/src/main/java/cn/lili/controller/other/CustomWordsController.java b/manager-api/src/main/java/cn/lili/controller/other/CustomWordsController.java index 8556775c2..ff2d56fb4 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/CustomWordsController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/CustomWordsController.java @@ -3,9 +3,7 @@ import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; -import cn.lili.common.enums.ResultCode; import cn.lili.common.enums.ResultUtil; -import cn.lili.common.exception.ServiceException; import cn.lili.common.vo.PageVO; import cn.lili.common.vo.ResultMessage; import cn.lili.modules.permission.SettingKeys; @@ -60,8 +58,9 @@ public String getCustomWords(String secretKey) { } JSONObject jsonObject = JSONUtil.parseObj(setting.getSettingValue()); + //如果密钥不正确,返回空 if (!secretKey.equals(jsonObject.get("secretKey"))) { - throw new ServiceException(ResultCode.CUSTOM_WORDS_SECRET_KEY_ERROR); + return ""; } String res = customWordsService.deploy();