|
|
@@ -9,16 +9,17 @@ import (
|
|
|
"crypto/md5"
|
|
|
"encoding/base64"
|
|
|
"encoding/hex"
|
|
|
+ "git.qianqiusoft.com/qianqiusoft/light-apiengine/config"
|
|
|
|
|
|
"git.qianqiusoft.com/qianqiusoft/light-apiengine/logs"
|
|
|
- "git.qianqiusoft.com/qianqiusoft/light-apiengine/config"
|
|
|
)
|
|
|
|
|
|
func HashPassword(password, salt string) string {
|
|
|
h := md5.New()
|
|
|
- enableDbSalt := config.AppConfig.GetBool("System::EnableDBSalt", true)
|
|
|
- customSalt := config.AppConfig.GetKey("System::PasswordSalt")
|
|
|
- enableBase64 := config.AppConfig.GetBool("System::PasswordEnableBase64", true)
|
|
|
+ enableDbSalt := config.AppConfig.GetBool("EnableDBSalt", true)
|
|
|
+ customSalt := config.AppConfig.GetKey("PasswordSalt")
|
|
|
+ enableBase64 := config.AppConfig.GetBool("PasswordEnableBase64", true)
|
|
|
+
|
|
|
if !enableDbSalt {
|
|
|
h.Write([]byte(password))
|
|
|
if len(customSalt) > 0 {
|