🐛修复新增管理员时密码未hash
This commit is contained in:
@@ -78,6 +78,8 @@ func (r user) Save(ent *entity.User) (err error) {
|
||||
defaultPassword := utils.Password().GenerateHashPassword("admin123")
|
||||
if ent.Password == "" { // 没有密码给一个默认密码
|
||||
ent.Password = defaultPassword
|
||||
} else {
|
||||
ent.Password = utils.Password().GenerateHashPassword(ent.Password)
|
||||
}
|
||||
|
||||
// 没有头像就生成一个头像
|
||||
|
Reference in New Issue
Block a user