14 lines
335 B
TypeScript
14 lines
335 B
TypeScript
import { TCPHandler, Context } from '..';
|
|
|
|
export default class UserInfo extends TCPHandler {
|
|
constructor() {
|
|
super();
|
|
this.endpoint = 'userinfo';
|
|
}
|
|
|
|
public async handle(ctx: Context) {
|
|
const account = await ctx.client.db.Account.findOne({ username: ctx.data.username });
|
|
return ctx.send(account.toJSON());
|
|
}
|
|
}
|