1
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
const crud = require("../service/biz_admin_crud");
|
||||
const { getRequestBody } = crud;
|
||||
|
||||
const tokenLogic = require("../service/biz_token_logic");
|
||||
const audit = require("../service/biz_audit_service");
|
||||
|
||||
module.exports = {
|
||||
"POST /biz_token/page": async (ctx) => {
|
||||
const body = getRequestBody(ctx);
|
||||
const body = ctx.getBody();
|
||||
const data = await crud.page("biz_api_token", body);
|
||||
ctx.success({ rows: data.rows, count: data.count });
|
||||
},
|
||||
"POST /biz_token/create": async (ctx) => {
|
||||
const body = getRequestBody(ctx);
|
||||
const body = ctx.getBody();
|
||||
const result = await tokenLogic.createToken(body);
|
||||
await audit.logAudit({
|
||||
admin_user_id: audit.pickAdminId(ctx),
|
||||
@@ -31,7 +31,7 @@ module.exports = {
|
||||
});
|
||||
},
|
||||
"POST /biz_token/revoke": async (ctx) => {
|
||||
const body = getRequestBody(ctx);
|
||||
const body = ctx.getBody();
|
||||
const row = await tokenLogic.revokeToken(body);
|
||||
await audit.logAudit({
|
||||
admin_user_id: audit.pickAdminId(ctx),
|
||||
@@ -43,7 +43,7 @@ module.exports = {
|
||||
ctx.success({ id: row.id, status: row.status });
|
||||
},
|
||||
"POST /biz_token/export": async (ctx) => {
|
||||
const body = getRequestBody(ctx);
|
||||
const body = ctx.getBody();
|
||||
const res = await crud.exportCsv("biz_api_token", body);
|
||||
ctx.success(res);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user