Files
social-router/packages/xhs/src/test/query/get-userinfo.ts
2025-05-03 04:48:12 +08:00

24 lines
601 B
TypeScript

import { xhsServices, program } from '../common.ts';
program
.command('get-userinfo')
.description('获取用户信息')
.action(async () => {
const client = xhsServices.getClient();
const res = await client.getSelfInfoV2();
console.log(res);
});
const getUserById = async (userId: string) => {
const client = xhsServices.getClient();
const res = await client.getUserInfoFromHtml(userId);
console.log(res);
};
program
.command('get-userinfo-by-id <userId>')
.description('获取用户信息')
.action(async (userId: string) => {
await getUserById(userId);
});