This commit is contained in:
张成
2026-04-01 15:02:45 +08:00
parent 38430c9244
commit 50bb0bc6ad
10 changed files with 257 additions and 2 deletions

View File

@@ -171,6 +171,18 @@ const definitions = {
required: ["user_id", "expire_at"],
properties: {
user_id: { type: "integer", format: "int64" },
key: { type: "string", description: "账号唯一标识,可选" },
token_name: { type: "string" },
expire_at: { type: "string" },
},
},
BizTokenEditRequest: {
type: "object",
title: "BizTokenEditRequest",
required: ["id"],
properties: {
id: { type: "integer", format: "int64" },
key: { type: "string", description: "可空表示清空" },
token_name: { type: "string" },
expire_at: { type: "string" },
},
@@ -306,6 +318,7 @@ paths["/admin_api/biz_subscription/export"] = post("订阅导出 CSV 数据", "B
paths["/admin_api/biz_token/page"] = post("API Token 分页(不含 secret_cipher", "BizAdminPageRequest");
paths["/admin_api/biz_token/create"] = post("创建 Token返回 plain_token", "BizTokenCreateRequest");
paths["/admin_api/biz_token/edit"] = post("编辑 Token名称/key/过期时间,不改密钥)", "BizTokenEditRequest");
paths["/admin_api/biz_token/revoke"] = post("吊销 Token", "BizTokenIdRequest");
paths["/admin_api/biz_token/regenerate"] = post("重新生成密钥(返回新 plain_token", "BizTokenIdRequest");
paths["/admin_api/biz_token/export"] = post("Token 导出", "BizAdminPageRequest");

View File

@@ -0,0 +1,34 @@
-- 订阅模块API Tokenbiz_api_token管理端菜单
-- 说明:
-- 1) 若执行报错「表不存在」,请将 `sys_menus` 改为实际表名(常见为 `sys_menu` 或 `sys_menus`)。
-- 2) parent_id挂到「订阅」等父菜单下时改为实际父菜单 id顶层可填 0。
-- 3) component 必须与 admin/src/router/component-map.js 的 key 一致(二选一):
-- subscription/token 或 subscription/biz_api_token
INSERT INTO `sys_menu` (
`name`,
`parent_id`,
`icon`,
`path`,
`type`,
`model_id`,
`form_id`,
`component`,
`api_path`,
`is_show_menu`,
`is_show`,
`sort`
) VALUES (
'API Token',
0,
'md-key',
'/subscription/token',
'页面',
0,
0,
'subscription/token',
'',
1,
1,
45
);

View File

@@ -3865,6 +3865,10 @@
"type": "integer",
"format": "int64"
},
"key": {
"type": "string",
"description": "账号唯一标识,可选"
},
"token_name": {
"type": "string"
},
@@ -4085,6 +4089,29 @@
]
}
}
},
"BizTokenEditRequest": {
"type": "object",
"title": "BizTokenEditRequest",
"required": [
"id"
],
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"key": {
"type": "string",
"description": "可空表示清空"
},
"token_name": {
"type": "string"
},
"expire_at": {
"type": "string"
}
}
}
},
"info": {
@@ -10492,6 +10519,50 @@
}
}
}
},
"/admin_api/biz_api_call_log/export": {
"post": {
"tags": [
"管理端-业务订阅"
],
"summary": "API 调用明细导出",
"parameters": [
{
"in": "body",
"name": "body",
"schema": {
"$ref": "#/definitions/BizAdminPageRequest"
}
}
],
"responses": {
"200": {
"description": "框架统一包装;成功时 code=0业务数据在 data"
}
}
}
},
"/admin_api/biz_token/edit": {
"post": {
"tags": [
"管理端-业务订阅"
],
"summary": "编辑 Token名称/key/过期时间,不改密钥)",
"parameters": [
{
"in": "body",
"name": "body",
"schema": {
"$ref": "#/definitions/BizTokenEditRequest"
}
}
],
"responses": {
"200": {
"description": "框架统一包装;成功时 code=0业务数据在 data"
}
}
}
}
},
"swagger": "2.0",