zhou.xiaoning il y a 2 ans
Parent
commit
b1bd14fec8
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      service/account/login.go

+ 3 - 3
service/account/login.go

@@ -91,13 +91,13 @@ func getLoginAccount(userName string, password string) (loginaccount *accountMod
 	if mobileEncrypted, _ := utils.AESEncrypt([]byte(userName), key); mobileEncrypted != nil {
 		// 从三方表获取LoginID
 		userauthinfo := &accountModel.Userauthinfo{
-			AUTHID:   string(mobileEncrypted),
+			AUTHID:   hex.EncodeToString(mobileEncrypted),
 			AUTHTYPE: 3,
 		}
-		if has, _ := global.M2A_DB.Get(&userauthinfo); has {
+		if has, _ := global.M2A_DB.Get(userauthinfo); has {
 			loginaccount = &accountModel.Loginaccount{
 				LOGINID:  userauthinfo.LOGINID,
-				PASSWORD: utils.EncoderSha256(fmt.Sprintf("%s%s", userName, pwd)), // 构建数据库存储的密码
+				PASSWORD: utils.EncoderSha256(fmt.Sprintf("%v%s", userauthinfo.LOGINID, pwd)), // 构建数据库存储的密码
 			}
 			if has, _ := global.M2A_DB.Get(loginaccount); has {
 				return