This commit is contained in:
cdle 2021-08-17 11:10:49 +08:00
parent 011d821dc2
commit c30184eafd
5 changed files with 45 additions and 7 deletions

5
.gitignore vendored
View File

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

2
conf/demo_app.conf Normal file
View File

@ -0,0 +1,2 @@
#扫码端口
httpport = 8080

37
conf/demo_config_.yaml Normal file
View File

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

0
conf/demo_reply.php Normal file
View File

View File

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