1
This commit is contained in:
@@ -1,18 +1,10 @@
|
||||
const auth = require("../service/biz_auth_verify");
|
||||
|
||||
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 {};
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
"POST /auth/verify": async (ctx) => {
|
||||
const body = getRequestBody(ctx);
|
||||
const body = ctx.getBody();
|
||||
const result = await auth.verifyRequest(body);
|
||||
ctx.success(result);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user