fix: fix update password invalid
This commit is contained in:
1 parent
b77f4b5a1b
commit
dcd6bc998a
1 file changed
+5
-4
+5
-4
@@ -199,10 +199,11 @@ func (e SysUser) Insert() (id int, err error) {
|
||||
|
||||
//修改
|
||||
func (e *SysUser) Update(id int) (update SysUser, err error) {
|
||||
//if err = e.Encrypt(); err != nil {
|
||||
// return
|
||||
//}
|
||||
e.Password = ""
|
||||
if e.Password!="" {
|
||||
if err = e.Encrypt(); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
if err = orm.Eloquent.Table(e.TableName()).First(&update, id).Error; err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user