请求日志: 显示响应体 + 新增 ShowFullUrl/ShowRunTime 配置(默认true)
This commit is contained in:
@@ -11,6 +11,7 @@ import simapi_serialization.*
|
||||
import simapi.communications.*
|
||||
import simapi.exceptions.*
|
||||
import simapi.configurations.*
|
||||
import simapi.helpers.*
|
||||
|
||||
/**
|
||||
* 异常处理中间件:全异常捕获,统一输出 HTTP 200 + JSON 响应。
|
||||
@@ -47,7 +48,7 @@ public class SimApiExceptionMiddleware <: IMiddleware {
|
||||
if (!context.response.hasStarted) {
|
||||
context.response.statusCode = 200
|
||||
context.response.contentType = "application/json; charset=utf-8"
|
||||
context.response.write(responseJson(response))
|
||||
SimApiResponseWriter.write(context, responseJson(response))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user