fix 之前被不小心覆盖的代码 导致wskey无法更新写入

This commit is contained in:
ZJY 2021-09-18 23:20:56 +08:00
parent 5be388907b
commit 7fb3332871

View File

@ -130,20 +130,43 @@ var handleMessage = func(msgs ...interface{}) interface{} {
}
if nck, err := GetJdCookie(ck.PtPin); err == nil {
nck.InPool(ck.PtKey)
msg := fmt.Sprintf("更新账号,%s", ck.PtPin)
if sender.IsQQ() {
ck.Update(QQ, ck.QQ)
nck.Update(PtKey, ck.PtKey)
if nck.WsKey == "" || len(nck.WsKey) == 0 {
if sender.IsQQ() {
ck.Update(QQ, ck.QQ)
}
nck.Update(WsKey, ck.WsKey)
msg := fmt.Sprintf("写入WsKey并更新账号%s", ck.PtPin)
sender.Reply(fmt.Sprintf(msg))
(&JdCookie{}).Push(msg)
logs.Info(msg)
} else {
if nck.WsKey == ck.WsKey {
msg := fmt.Sprintf("重复写入")
sender.Reply(fmt.Sprintf(msg))
(&JdCookie{}).Push(msg)
logs.Info(msg)
} else {
nck.Updates(JdCookie{
WsKey: ck.WsKey,
})
msg := fmt.Sprintf("更新WsKey并更新账号%s", ck.PtPin)
sender.Reply(fmt.Sprintf(msg))
(&JdCookie{}).Push(msg)
logs.Info(msg)
}
}
sender.Reply(fmt.Sprintf(msg))
sender.Reply(ck.Query())
(&JdCookie{}).Push(msg)
} else {
NewJdCookie(&ck)
msg := fmt.Sprintf("添加账号,账号名:%s", ck.PtPin)
if sender.IsQQ() {
ck.Update(QQ, ck.QQ)
}
sender.Reply(fmt.Sprintf(msg))
sender.Reply(ck.Query())
(&JdCookie{}).Push(msg)