feat: 添加 Repo 和 User 模块,增强 CNBCore 功能

This commit is contained in:
2025-12-15 17:08:39 +08:00
parent 5e43eb2db7
commit 52ccf115fb
9 changed files with 390 additions and 32 deletions

19
src/user/index.ts Normal file
View File

@@ -0,0 +1,19 @@
import { CNBCore, CNBCoreOptions } from "../cnb-core";
export class User extends CNBCore {
constructor(options: CNBCoreOptions<{}>) {
super({ token: options.token, cookie: options.cookie });
}
/**
* 获取当前用户信息
* @returns
*/
getCurrentUser(): Promise<any> {
const url = `https://cnb.cool/user`;
return this.get({
url,
useCookie: true,
});
}
}