From 8927b8b6224fe77ba2aa2f8728d8c1d42772bf47 Mon Sep 17 00:00:00 2001 From: ZJY <764763903@qq.com> Date: Wed, 29 Sep 2021 14:00:32 +0800 Subject: [PATCH] =?UTF-8?q?add=20QQ=E6=89=AB=E7=A0=81=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/login.go | 2 +- models/db.go | 1 + qbot/main.go | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/controllers/login.go b/controllers/login.go index c368d35..37ad9f4 100644 --- a/controllers/login.go +++ b/controllers/login.go @@ -507,7 +507,7 @@ func (c *LoginController) SMSLogin() { ck.Query() msg := fmt.Sprintf("来自短信的添加,账号:%s,QQ: %s", ck.PtPin, qq) (&models.JdCookie{}).Push(msg) - } else if !models.HasKey(ptKey) { + } else { ck, _ := models.GetJdCookie(ptPin) ck.InPool(ptKey) if qq != "" { diff --git a/models/db.go b/models/db.go index 3b33382..8998cd4 100644 --- a/models/db.go +++ b/models/db.go @@ -202,6 +202,7 @@ func (ck *JdCookie) Removes(values interface{}) { db.Model(ck).Delete(values) } if ck.PtPin != "" { + db.Model(&JdCookiePool{}).Where(PtPin+" = ?", ck.PtPin).Delete(values) db.Model(ck).Where(PtPin+" = ?", ck.PtPin).Delete(values) } } diff --git a/qbot/main.go b/qbot/main.go index 143ce34..c3fbf43 100644 --- a/qbot/main.go +++ b/qbot/main.go @@ -80,7 +80,10 @@ func Main() { case *http.Response: data, _ := ioutil.ReadAll(msg.(*http.Response).Body) bot.SendPrivateMessage(uid, models.Config.QQGroupID, &message.SendingMessage{Elements: []message.IMessageElement{&coolq.LocalImageElement{Stream: bytes.NewReader(data)}}}) + case byte: + } + } models.SendQQGroup = func(gid int64, uid int64, msg interface{}) { if bot == nil {