From 31c7d18db7e9480a290809b6c98185a00a1fa19a Mon Sep 17 00:00:00 2001 From: johlanse Date: Fri, 27 May 2022 20:20:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=93=E9=A1=B9=E7=AD=94=E9=A2=98=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=9C=80=E5=B0=8F=E5=8F=AF=E6=8E=A5=E6=94=B6=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/config.go | 5 +++++ lib/config_default.yml | 5 ++++- main.go | 3 --- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/config.go b/lib/config.go index 9c804a9..f735c37 100644 --- a/lib/config.go +++ b/lib/config.go @@ -54,6 +54,8 @@ type Config struct { // 重试时间 Intervals int `json:"intervals" yaml:"intervals"` } `json:"retry" yaml:"retry"` + // 专项答题可接受的最小值 + SpecialMinScore int `json:"special_min_score" yaml:"special_min_score"` } var ( @@ -91,5 +93,8 @@ func GetConfig() Config { if config.Scheme == "" { config.Scheme = "https://johlanse.github.io/study_xxqg/scheme.html?" } + if config.SpecialMinScore == 0 { + config.SpecialMinScore = 10 + } return config } diff --git a/lib/config_default.yml b/lib/config_default.yml index 9390b55..1876091 100644 --- a/lib/config_default.yml +++ b/lib/config_default.yml @@ -72,4 +72,7 @@ edge_path: "" qr_code: false # 启动时等待时间,为了防止代理启动比软件慢而报错,默认不等待,单位秒 -start_wait: 0 \ No newline at end of file +start_wait: 0 + +# 专项答题可接受的最小分值,因一天重复运行的时候,若专项答题未能答满会继续答新的一套题,会浪费题 +special_min_score: 10 \ No newline at end of file diff --git a/main.go b/main.go index 3fe96a1..c36eca2 100644 --- a/main.go +++ b/main.go @@ -158,9 +158,6 @@ func do(m string) { core.Init() var user *model.User users, _ := model.Query() - for i := 0; i < 25; i++ { - core.Push("text", "登录") - } study := func(core2 *lib.Core, u *model.User) { go core2.LearnArticle(u) go core2.LearnVideo(u)