Commit 1b00f31a authored by 赵啸非's avatar 赵啸非

提交配置校验

parent bc7dde3f
...@@ -7,6 +7,7 @@ import org.slf4j.Logger; ...@@ -7,6 +7,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.converter.HttpMessageNotReadableException; import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.messaging.handler.annotation.support.MethodArgumentTypeMismatchException;
import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
...@@ -46,14 +47,13 @@ public class ExceptionHandle { ...@@ -46,14 +47,13 @@ public class ExceptionHandle {
stack.getClassName(), stack.getMethodName(), stack.getLineNumber(), e.getClass().getName()); stack.getClassName(), stack.getMethodName(), stack.getLineNumber(), e.getClass().getName());
AppException ex = (AppException) e; AppException ex = (AppException) e;
ret.put(KEY_RESULT_MSG, ex.getMessage()); ret.put(KEY_RESULT_MSG, ex.getMessage());
} } else if (e instanceof HttpMessageNotReadableException || e instanceof MethodArgumentTypeMismatchException) {
if (e instanceof HttpMessageNotReadableException) {
log.error("[system error]", e); log.error("[system error]", e);
response.setStatus(HttpStatus.HTTP_BAD_REQUEST); response.setStatus(HttpStatus.HTTP_BAD_REQUEST);
ret.put(KEY_RESULT_MSG, "参数错误,"+ StrUtil.subBefore(e.getMessage(), ";", false)); ret.put(KEY_RESULT_MSG, "参数错误," + StrUtil.subBefore(e.getMessage(), ";", false));
} else { } else {
log.error("[system error]", e); log.error("[system error]", e);
response.setStatus(HttpStatus.HTTP_INTERNAL_ERROR); response.setStatus(HttpStatus.HTTP_BAD_REQUEST);
ret.put(KEY_RESULT_MSG, "未知错误!" + e.getMessage()); ret.put(KEY_RESULT_MSG, "未知错误!" + e.getMessage());
} }
return ret.toJSONString(); return ret.toJSONString();
......
...@@ -92,7 +92,7 @@ client.global.set("App_id", JSON.parse(response.body).data.id); ...@@ -92,7 +92,7 @@ client.global.set("App_id", JSON.parse(response.body).data.id);
%} %}
###自助终端应用查看 ###自助终端应用查看
GET {{baseUrl}}/app/info?id=1 GET {{baseUrl}}/app/interinfo?id=19999999999999999999999
Accept: application/json Accept: application/json
###自助终端应用编辑 ###自助终端应用编辑
......
...@@ -59,6 +59,10 @@ Accept: application/json ...@@ -59,6 +59,10 @@ Accept: application/json
GET {{baseUrl}}/cipher/check GET {{baseUrl}}/cipher/check
Accept: application/json Accept: application/json
###license check1
GET http://192.168.0.250:11078/zwfw/cipher/check
Accept: application/json
### 测试 ### 测试
GET http://192.168.0.98:11072/zwfw_api/admin/statistic/ages?selected=1& substr(user,1,1) = 'a' GET http://192.168.0.98:11072/zwfw_api/admin/statistic/ages?selected=1& substr(user,1,1) = 'a'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment