1
This commit is contained in:
@@ -2,15 +2,7 @@ const swagger = require("../../_docs/swagger.json");
|
||||
const auth = require("../service/biz_auth_verify");
|
||||
const proxy = require("../service/biz_proxy_service");
|
||||
|
||||
function getRequestBody(ctx) {
|
||||
if (ctx.request && ctx.request.body && Object.keys(ctx.request.body).length > 0) {
|
||||
return ctx.request.body;
|
||||
}
|
||||
if (typeof ctx.getBody === "function") {
|
||||
return ctx.getBody() || {};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 从请求中提取 Token
|
||||
@@ -69,7 +61,7 @@ function buildProxyRoutes() {
|
||||
api_path: path,
|
||||
method: method.toUpperCase(),
|
||||
query,
|
||||
body: getRequestBody(ctx),
|
||||
body: ctx.getBody(),
|
||||
headers: ctx.headers || {},
|
||||
auth_ctx: authResult.context,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user