Skip to content

Commit

Permalink
!284 解决jfinal5开启兼容json请求解析功能后报类转换异常问题
Browse files Browse the repository at this point in the history
Merge pull request !284 from yangghosts/N/A
  • Loading branch information
click33 authored and gitee-org committed Oct 17, 2023
2 parents 954efeb + e5fb308 commit 4607f51
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ public void handle(String target, HttpServletRequest request, HttpServletRespons
// Controller controller = action.getControllerClass().newInstance();
controller = controllerFactory.getController(action.getControllerClass());
CPI._init_(controller, action, request, response, urlPara[0]);
//加入SaToken上下文处理
if (resolveJson && controller.isJsonRequest()) {
// 注入 JsonRequest 包装对象接管 request
controller.setHttpServletRequest(jsonRequestFactory.apply(controller.getRawData(), controller.getRequest()));
}
//加入SaToken上下文处理
SaControllerContext.hold(controller);

if (devMode) {
if (actionReporter.isReportAfterInvocation(request)) {
new Invocation(action, controller).invoke();
Expand Down

0 comments on commit 4607f51

Please sign in to comment.