Add user management features.

This commit is contained in:
2025-05-14 18:49:49 +08:00
parent 3b7d52a7a8
commit 703812d3df
10 changed files with 447 additions and 40 deletions

View File

@@ -141,6 +141,21 @@ class Network {
}
}
async changeUsername(username: string): Promise<Response<User>> {
try {
const response = await axios.postForm(`${this.apiBaseUrl}/user/username`, {
username
})
return response.data
} catch (e: any) {
console.error(e)
return {
success: false,
message: e.toString(),
}
}
}
getUserAvatar(user: User): string {
return this.baseUrl + user.avatar_path
}