From c30184eafdf93f4ee38243c02bc69b9c36188ec7 Mon Sep 17 00:00:00 2001 From: cdle <798731886@qq.com> Date: Tue, 17 Aug 2021 11:10:49 +0800 Subject: [PATCH] x --- .gitignore | 5 ++++- conf/demo_app.conf | 2 ++ conf/demo_config_.yaml | 37 +++++++++++++++++++++++++++++++++++++ conf/demo_reply.php | 0 models/config.go | 8 ++------ 5 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 conf/demo_app.conf create mode 100644 conf/demo_config_.yaml create mode 100644 conf/demo_reply.php diff --git a/.gitignore b/.gitignore index 3475ee8..9db85c9 100644 --- a/.gitignore +++ b/.gitignore @@ -16,5 +16,8 @@ session.token device.json data/ logs/ -conf +conf/app.conf +conf/config.yaml +conf/config_cdle.yaml +conf/reply.php jdCookie.js \ No newline at end of file diff --git a/conf/demo_app.conf b/conf/demo_app.conf new file mode 100644 index 0000000..edf7544 --- /dev/null +++ b/conf/demo_app.conf @@ -0,0 +1,2 @@ +#扫码端口 +httpport = 8080 \ No newline at end of file diff --git a/conf/demo_config_.yaml b/conf/demo_config_.yaml new file mode 100644 index 0000000..8851dbd --- /dev/null +++ b/conf/demo_config_.yaml @@ -0,0 +1,37 @@ +mode: parallel +containers: + - address: http://192.168.31.233:5700 + username: admin + password: admin + weigth: + mode: parallel + limit: 9999 +theme: +static: ./static +master: +database: +qywx_key: +daily_push: +resident: +user_agent: +telegram_bot_token: +telegram_user_id: +qquid: +qqgid: +default_priority: +no_ghproxy: true +daily_asset_push_cron: +tasks: + - cron: 0 6 * * * + path: https://raw.githubusercontent.com/cdle/xdd/main/scripts/jd_goodMorning.js + enable: true + word: 早起福利 + mode: obo + - cron: 0 0 * * * + path: https://raw.githubusercontent.com/cdle/xdd/main/scripts/jd_angryBean.js + enable: true + word: 抢京豆 + mode: alo + envs: + - name: angryBeanPins + - value: jd_xxxxx&jd_ooooo diff --git a/conf/demo_reply.php b/conf/demo_reply.php new file mode 100644 index 0000000..e69de29 diff --git a/models/config.go b/models/config.go index 71f64f2..2d3b37e 100644 --- a/models/config.go +++ b/models/config.go @@ -52,7 +52,7 @@ func initConfig() { if _, err := os.Stat(confDir); err != nil { os.MkdirAll(confDir, os.ModePerm) } - for _, name := range []string{"app.conf", "config.yaml"} { + for _, name := range []string{"app.conf", "config.yaml", "reply.php"} { f, err := os.OpenFile(ExecPath+"/conf/"+name, os.O_RDWR|os.O_CREATE, 0777) if err != nil { logs.Warn(err) @@ -67,11 +67,7 @@ func initConfig() { } f.Close() } - config := ExecPath + "/conf/config.yaml" - if Cdle { - config = ExecPath + "/conf/config_cdle.yaml" - } - content, err := ioutil.ReadFile(config) + content, err := ioutil.ReadFile(ExecPath + "/conf/config.yaml") if err != nil { logs.Warn("解析config.yaml读取错误: %v", err) }