This commit is contained in:
张成
2026-04-01 10:13:22 +08:00
parent 14f5d75d9d
commit 494555a6e1
11 changed files with 52 additions and 90 deletions

View File

@@ -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);
},