fix🐛: 添加bcrypt包的引用

This commit is contained in:
zhangwenjian committed 2022-07-27 21:49:24 +08:00
1 parent 70bd8b26ad
commit f469536174
2 files changed
+4 -1

No files matched your search

+1
View File
@@ -4,6 +4,7 @@ import (
"github.com/gin-gonic/gin/binding"
"github.com/go-admin-team/go-admin-core/sdk/config"
"go-admin/app/admin/models"
"golang.org/x/crypto/bcrypt"
"net/http"
"github.com/gin-gonic/gin"
+3 -1
View File
@@ -233,7 +233,9 @@ func (e *SysUser) UpdatePwd(id int, oldPassword, newPassword string, p *actions.
return err
}
c.Password = newPassword
db := e.Orm.Model(c).Where("user_id = ?", id).Select("Password", "Salt").Updates(c)
db := e.Orm.Model(c).Where("user_id = ?", id).
Select("Password", "Salt").
Updates(c)
if err = db.Error; err != nil {
e.Log.Errorf("db error: %s", err)
return err