add QQ扫码登录

This commit is contained in:
ZJY 2021-09-29 14:00:32 +08:00
parent 7d712ef402
commit 8927b8b622
3 changed files with 5 additions and 1 deletions

View File

@ -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 != "" {

View File

@ -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)
}
}

View File

@ -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 {