Skip to content

Commit dcedd4e

Browse files
committed
refactor(jike-client): expose user profile
1 parent fc34629 commit dcedd4e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/client/user.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface FollowerWithTime {
1919
export class JikeUser<M extends boolean = boolean> {
2020
#client: JikeClient
2121
#username?: string
22-
#profile?: Users.Profile<M>
22+
profile?: Users.Profile<M>
2323

2424
constructor(
2525
client: JikeClient,
@@ -28,7 +28,7 @@ export class JikeUser<M extends boolean = boolean> {
2828
) {
2929
this.#client = client
3030
this.#username = username
31-
this.#profile = profile
31+
this.profile = profile
3232
}
3333

3434
/**
@@ -62,14 +62,14 @@ export class JikeUser<M extends boolean = boolean> {
6262
* @param ignoreCache 不使用缓存
6363
*/
6464
async queryProfile(ignoreCache = false) {
65-
if (!ignoreCache && this.#profile) return this.#profile
65+
if (!ignoreCache && this.profile) return this.profile
6666

6767
const result = await this.#client.apiClient.users.profile(this.#username)
6868
if (!isSuccess(result)) throwRequestFailureError(result, '查询用户信息')
69-
this.#profile = result.data
70-
this.#username = this.#profile.user.username
69+
this.profile = result.data
70+
this.#username = this.profile.user.username
7171

72-
return this.#profile
72+
return this.profile
7373
}
7474

7575
/**

0 commit comments

Comments
 (0)