chore: remove useless & add getAvatarFileHash
This commit is contained in:
@@ -124,8 +124,8 @@ export default class User {
|
|||||||
setPassword(password: string) {
|
setPassword(password: string) {
|
||||||
this.setAttr("password", password)
|
this.setAttr("password", password)
|
||||||
}
|
}
|
||||||
getAvatar(): Buffer | null {
|
getAvatarFileHash() {
|
||||||
return this.bean.avatar_file_hash != null ? FileManager.findByHash(this.bean.avatar_file_hash)?.readSync() : null
|
return this.bean.avatar_file_hash
|
||||||
}
|
}
|
||||||
async setAvatar(avatar: Buffer) {
|
async setAvatar(avatar: Buffer) {
|
||||||
this.setAttr("avatar_file_hash", (await FileManager.uploadFile(`avatar_user_${this.bean.count}`, avatar)).getHash())
|
this.setAttr("avatar_file_hash", (await FileManager.uploadFile(`avatar_user_${this.bean.count}`, avatar)).getHash())
|
||||||
|
|||||||
Reference in New Issue
Block a user