fix 空pin可导入

This commit is contained in:
ZJY 2021-10-03 10:50:10 +08:00
parent 0df1628e7f
commit 8c1a2e862e
2 changed files with 6 additions and 59 deletions

View File

@ -212,7 +212,7 @@ var handleMessage = func(msgs ...interface{}) interface{} {
if strings.Contains(msg, "pt_key") {
ptKey := FetchJdCookieValue("pt_key", msg)
ptPin := FetchJdCookieValue("pt_pin", msg)
if len(ptPin) > 0 || len(ptKey) > 0 {
if len(ptPin) > 0 && len(ptKey) > 0 {
ck := JdCookie{
PtKey: ptKey,
PtPin: ptPin,
@ -260,64 +260,6 @@ var handleMessage = func(msgs ...interface{}) interface{} {
return nil
}
}
{ //
ss := regexp.MustCompile(`pt_key=([^;=\s]+);pt_pin=([^;=\s]+)`).FindAllStringSubmatch(msg, -1)
if len(ss) > 0 {
xyb := 0
for _, s := range ss {
ck := JdCookie{
PtKey: s[1],
PtPin: s[2],
}
if len(PtPin) > 0 {
if CookieOK(&ck) {
xyb++
if sender.IsQQ() {
ck.QQ = sender.UserID
} else if sender.IsTG() {
ck.Telegram = sender.UserID
}
if HasKey(ck.PtKey) {
sender.Reply(fmt.Sprintf("重复提交"))
} else {
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)
}
sender.Reply(fmt.Sprintf(msg))
(&JdCookie{}).Push(msg)
logs.Info(msg)
} else {
if Cdle {
ck.Hack = True
}
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())
logs.Info(msg)
}
}
} else {
sender.Reply(fmt.Sprintf("无效,互助值-1余额%d", RemCoin(sender.UserID, 1)))
}
}
}
go func() {
Save <- &JdCookie{}
}()
return nil
}
}
{
o := findShareCode(msg)
if o != "" {

View File

@ -7,6 +7,11 @@
# 更新日志
## 10-03
- 修复空pin可导入问题
- 剔除ck批量导入功能
## 10-02
- 修复删除指令没有删除jdcookiepool