add 新增清空wck指令

This commit is contained in:
ZJY 2021-09-28 09:00:15 +08:00
parent 171a3f3e43
commit 07f5afc5f5
2 changed files with 22 additions and 0 deletions

View File

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

View File

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