add 新增配置参数默认禁用wskey转换 需要的填true新增配置 默认关闭wskey

This commit is contained in:
ZJY 2021-09-18 21:59:02 +08:00
parent 004a4ec51a
commit 52f7eb27d0
6 changed files with 47 additions and 31 deletions

View File

@ -12,6 +12,7 @@ AtTime: #填写1-12之间的数 填错自负默认为10 10点容易出现高
IsHelp: #填写true或者false false
IsOldV4: #填写true或者false false是否新版或者旧版V4
ApiToken: #为空默认随机禁用
Wskey: # 填空默认禁用wskey转换 需要的填true
theme:
static: ./static
master:

View File

@ -352,8 +352,7 @@ func (c *LoginController) CkLogin() {
logs.Info(pin)
logs.Info(key)
c.Ctx.Redirect(200, "/userCenter?pin="+pin)
c.StopRun()
c.Ctx.WriteString("添加成功")
//if key != "" && pin != "" {
// //ptKey := FetchJdCookieValue("pt_key", cookies)
// //ptPin := FetchJdCookieValue("pt_pin", cookies)

View File

@ -207,28 +207,33 @@ func CookieOK(ck *JdCookie) bool {
if ui.Msg == "not login" {
if ck.Available == True {
ck.Push(fmt.Sprintf("失效账号,%s", ck.PtPin))
ck.Update(Available, false)
JdCookie{}.Push(fmt.Sprintf("失效账号,%s", ck.Nickname))
if len(ck.WsKey) > 0 {
var pinky = fmt.Sprintf("pin=%s;wskey=%s;", ck.PtPin, ck.WsKey)
msg := cmd(fmt.Sprintf(`python3 test.py "%s"`, pinky), &Sender{})
JdCookie{}.Push(fmt.Sprintf("自动转换wskey---%s", msg))
ptKey := FetchJdCookieValue("pt_key", msg)
ptPin := FetchJdCookieValue("pt_pin", msg)
ck := JdCookie{
PtKey: ptKey,
PtPin: ptPin,
}
if nck, err := GetJdCookie(ck.PtPin); err == nil {
nck.InPool(ck.PtKey)
msg := fmt.Sprintf("更新账号,%s", ck.PtPin)
(&JdCookie{}).Push(msg)
logs.Info(msg)
} else {
nck.Update(Available, false)
(&JdCookie{}).Push("转换失败")
if Config.Wskey {
ck.Push(fmt.Sprintf("失效账号,%s", ck.PtPin))
ck.Update(Available, false)
JdCookie{}.Push(fmt.Sprintf("失效账号,%s", ck.Nickname))
if len(ck.WsKey) > 0 {
var pinky = fmt.Sprintf("pin=%s;wskey=%s;", ck.PtPin, ck.WsKey)
msg := cmd(fmt.Sprintf(`python3 test.py "%s"`, pinky), &Sender{})
JdCookie{}.Push(fmt.Sprintf("自动转换wskey---%s", msg))
ptKey := FetchJdCookieValue("pt_key", msg)
ptPin := FetchJdCookieValue("pt_pin", msg)
ck := JdCookie{
PtKey: ptKey,
PtPin: ptPin,
}
if nck, err := GetJdCookie(ck.PtPin); err == nil {
nck.InPool(ck.PtKey)
msg := fmt.Sprintf("更新账号,%s", ck.PtPin)
(&JdCookie{}).Push(msg)
logs.Info(msg)
} else {
nck.Update(Available, false)
(&JdCookie{}).Push("转换失败")
}
}
} else {
ck.Push(fmt.Sprintf("失效账号,%s", ck.PtPin))
JdCookie{}.Push(fmt.Sprintf("失效账号,%s", ck.Nickname))
}
}

View File

@ -36,6 +36,7 @@ type Yaml struct {
IsHelp bool `yaml:"IsHelp"`
IsOldV4 bool `yaml:"IsOldV4"`
ApiToken string `yaml:"ApiToken"`
Wskey bool `yaml:"Wskey"`
Node string
Npm string
Python string

View File

@ -14,10 +14,18 @@ func intiSky() {
//定时任务
spec := "0 " + strconv.Itoa(rand.Intn(59)) + " " + Config.CTime + "/12 * * ?" //cron表达式每秒一次
logs.Info(spec)
c.AddFunc(spec, func() {
fmt.Println("开始wskey转换")
updateCookie()
})
if Config.Wskey {
c.AddFunc(spec, func() {
fmt.Println("开始wskey转换")
updateCookie()
})
c.Start()
c.Start()
}
//c.AddFunc(spec, func() {
// fmt.Println("开始wskey转换")
// updateCookie()
//})
//
//c.Start()
}

View File

@ -36,15 +36,17 @@ fix 重大BUG修复解决以下几个问题
2.不管是CK新增还是WSKEY新增账号导致清空CK由1导致的
3.新增添加后自动回复查询参数。
4.修复账号无限判错问题。
新增纯CK版本 可配置调整为WSKEY+CK 和纯CK版本
Wskey: # 填空默认禁用wskey转换 需要的填true新增配置 默认关闭wskey
需要的自己设置下
以上是做完了 以下是待开发
新增纯CK版本 可配置调整为WSKEY+CK 和纯CK版本
验证码登录直接接入
plus登陆页面 ---会员中心给你们看个样板图把
考虑仓库私有化 另附如果不喜欢别用 ninja和xdd魔改版大有人做 免费开源没收你钱总不能还挨你一顿喷?
编码问题参考
https://blog.csdn.net/qq_29499107/article/details/83583983
/usr/lib64/python3.6/http