📅  最后修改于: 2022-03-11 14:48:17.959000             🧑  作者: Mango
@beforeSave()
public static async hashPassword (user: User) {
if (user.$dirty.password) {
user.password = await Hash.make(user.password)
}
}