Commit db9ed37c by xuzhenhao

修复bug

1 parent 655ad2ed
......@@ -8,7 +8,7 @@ import (
"gopkg.in/gin-gonic/gin.v1"
// "io"
// "io/ioutil"
// "log"
"log"
"net/http"
// "net/url"
// "os"
......
......@@ -102,13 +102,24 @@ func ChangeUserPassword(userName string, originPassword string, newPassword stri
}
password := MD5(newPassword)
sql := ` update icesimba_polysdk_user set user_password = ? where user_name = ?`
err = db.Engine.Exec(sql, password, userName)
_, err = db.Engine.Exec(sql, password, userName)
if err != nil {
return "104001", err
}
return
}
//添加用户
func InsertUser(userName string, userPassword string) (result interface{}, err error) {
sql := ` insert into icesimba_polysdk_user(user_name,user_password) values(?,?) `
_, err = db.Engine.Exec(sql, userName, userPassword)
if err != nil {
return "104001", err
}
return nil, nil
}
func MD5(str string) string {
w := md5.New()
w.Write([]byte(str))
......
......@@ -4,7 +4,7 @@ import (
_ "github.com/gin-gonic/autotls"
"gopkg.in/gin-gonic/gin.v1"
. "loginserver/apis"
"net/http"
// "net/http"
// "log"
)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!