diff --git a/models/available.go b/models/available.go index 9e61d0e..bed375c 100644 --- a/models/available.go +++ b/models/available.go @@ -156,6 +156,20 @@ func cleanCookie() { (&JdCookie{}).Push(fmt.Sprintf("所有CK清理,共%d个", xx)) } +func cleanWck() { + cks := GetJdCookies() + xx := 0 + (&JdCookie{}).Push("开始清空Wskey") + for i := range cks { + if len(cks[i].WsKey) > 0 { + ck := cks[i] + ck.Update(WsKey, "") + xx++ + } + } + (&JdCookie{}).Push(fmt.Sprintf("已清理WCK,一共%d", xx)) +} + func updateCookie() { cks := GetJdCookies() l := len(cks) diff --git a/models/command.go b/models/command.go index e459734..8d789c5 100644 --- a/models/command.go +++ b/models/command.go @@ -116,6 +116,14 @@ var codeSignals = []CodeSignal{ return Count() }, }, + { + Command: []string{"清空WCK"}, + Admin: true, + Handle: func(sender *Sender) interface{} { + updateCookie() + return nil + }, + }, { Command: []string{"删除WCK"}, Admin: true,