1
This commit is contained in:
@@ -45,6 +45,21 @@ module.exports = {
|
||||
warn: result.warn,
|
||||
});
|
||||
},
|
||||
"POST /biz_token/edit": async (ctx) => {
|
||||
const body = ctx.getBody();
|
||||
const row = await tokenLogic.updateToken(body);
|
||||
await audit.logAudit({
|
||||
admin_user_id: audit.pickAdminId(ctx),
|
||||
biz_user_id: row.user_id,
|
||||
action: "biz_token.edit",
|
||||
resource_type: "biz_api_token",
|
||||
resource_id: row.id,
|
||||
detail: { token_name: row.token_name, key: row.key },
|
||||
});
|
||||
const plain = row.get ? row.get({ plain: true }) : { ...row };
|
||||
delete plain.secret_cipher;
|
||||
ctx.success(plain);
|
||||
},
|
||||
"POST /biz_token/revoke": async (ctx) => {
|
||||
const body = ctx.getBody();
|
||||
const row = await tokenLogic.revokeToken(body);
|
||||
|
||||
Reference in New Issue
Block a user