瀏覽代碼

修改登录BUG

zhou.xiaoning 4 年之前
父節點
當前提交
bf433e6f4d
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      models/account.go

+ 2 - 2
models/account.go

@@ -583,7 +583,7 @@ func GetLoginAccountByMobile(mobile string) (*Loginaccount, error) {
 	if mobileEncrypted, err := utils.AESEncrypt([]byte(mobile), key); err == nil {
 		// 加密成功后进行查询
 		has, err = engine.Join("INNER", "USERINFO", "USERINFO.USERID = LOGINACCOUNT.USERID").
-			Where("USERINFO.MOBILE = ?", hex.EncodeToString(mobileEncrypted)).Get(&loginaccount)
+			Where("USERINFO.USERSTATUS = 1 and USERINFO.MOBILE = ?", hex.EncodeToString(mobileEncrypted)).Get(&loginaccount)
 		if err != nil {
 			return nil, err
 		}
@@ -606,7 +606,7 @@ func GetLoginAccount2(mobile string) (*Loginaccount, error) {
 	key, _ := hex.DecodeString(utils.AESSecretKey)
 	if mobileEncrypted, err := utils.AESEncrypt([]byte(mobile), key); err == nil {
 		// 加密成功后进行查询
-		has, err = engine.Where("MOBILE = ?", hex.EncodeToString(mobileEncrypted)).Get(&loginaccount)
+		has, err = engine.Where("LOGINSTATUS = 1 and MOBILE = ?", hex.EncodeToString(mobileEncrypted)).Get(&loginaccount)
 		if err != nil {
 			return nil, err
 		}