|
@@ -4,6 +4,7 @@ import (
|
|
|
"encoding/base64"
|
|
|
"sparrow/pkg/generator"
|
|
|
"sparrow/pkg/models"
|
|
|
+ "sparrow/pkg/server"
|
|
|
"sparrow/pkg/utils"
|
|
|
"sparrow/services/knowoapi/model"
|
|
|
)
|
|
@@ -63,8 +64,10 @@ func (a userservice) Register(user *models.Reqrequest) (*models.User, error) {
|
|
|
func (a userservice) ModifyPassword(userid uint, new, old string) (bool, error) {
|
|
|
obytes, _ := base64.StdEncoding.DecodeString(old)
|
|
|
nbytes, _ := base64.StdEncoding.DecodeString(new)
|
|
|
+ server.Log.Debugf("旧密码:%s, 新密码:%s")
|
|
|
old = utils.Md5(string(obytes) + model.SignedString)
|
|
|
new = utils.Md5(string(nbytes) + model.SignedString)
|
|
|
+ server.Log.Debugf("旧密码:%s, 新密码:%s, 旧加密:%s,新加密:%s", string(obytes), string(nbytes), old, new)
|
|
|
return a.model.User.UpdatePassword(userid, new, old)
|
|
|
}
|
|
|
|