This commit is contained in:
cdle 2021-08-20 10:25:31 +08:00
parent ea466ce5b4
commit 81ecbb9e97
4 changed files with 6 additions and 4 deletions

View File

@ -106,7 +106,7 @@ var handleMessage = func(msgs ...interface{}) interface{} {
if !isAdmin(msgs...) {
return "你没有权限操作"
}
return fmt.Sprintf("操作成功,更新%d条记录", db.Model(JdCookie{}).Update(Hack, False).RowsAffected)
return fmt.Sprintf("操作成功,更新%d条记录", db.Model(JdCookie{}).Where(fmt.Sprintf("%s != ?", Hack), False).Update(Hack, False).RowsAffected)
case "status", "状态":
if !isAdmin(msgs...) {
return "你没有权限操作"

View File

@ -48,7 +48,6 @@ func initDB() {
keys[jp.PtKey] = true
pins[jp.PtPin] = true
}
db.Model(JdCookie{}).Where(fmt.Sprintf("%s = ?", Hack), "").Update(Hack, False)
}
func HasPin(pin string) bool {
@ -224,6 +223,9 @@ func (ck *JdCookie) OutPool() (string, error) {
}
func NewJdCookie(ck *JdCookie) error {
if ck.Hack == "" {
ck.Hack = False
}
ck.Priority = Config.DefaultPriority
date := Date()
ck.CreateAt = date

View File

@ -64,7 +64,7 @@ module.exports = cookies`, cookies))
f.Close()
tmp = []JdCookie{}
for _, ck := range cks {
if ck.Hack == False {
if ck.Hack != True {
tmp = append(tmp, ck)
}
}

View File

@ -11,7 +11,7 @@ import (
"github.com/beego/beego/v2/core/logs"
)
var version = "2021082005"
var version = "2021082006"
var AppName = "xdd"
var pname = regexp.MustCompile(`/([^/\s]+)`).FindStringSubmatch(os.Args[0])[1]