generated from tailored/router-db-template
24 lines
601 B
TypeScript
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);
|
|
});
|