This commit is contained in:
张成
2025-11-26 20:25:02 +08:00
parent 60f13c3ad7
commit 4db078c80a
6 changed files with 167 additions and 17 deletions

View File

@@ -56,8 +56,22 @@ module.exports = {
*/
'POST /account/list': async (ctx) => {
const body = ctx.getBody();
const { key, value, platform_type, is_online } = body;
const { limit, offset } = ctx.getPageSize();
// 支持两种参数格式:直接传参或通过 seachOption 传递
const seachOption = body.seachOption || {};
const pageOption = body.pageOption || {};
// 获取搜索参数(优先使用 seachOption兼容直接传参
const key = seachOption.key || body.key;
const value = seachOption.value || body.value;
const platform_type = seachOption.platform_type || body.platform_type;
const is_online = seachOption.is_online !== undefined ? seachOption.is_online : body.is_online;
// 获取分页参数
const page = pageOption.page || body.page || 1;
const pageSize = pageOption.pageSize || body.pageSize || 20;
const limit = pageSize;
const offset = (page - 1) * pageSize;
const result = await plaAccountService.getAccountList({
key,