添加web文档
This commit is contained in:
parent
3127abce1a
commit
b0816c2105
16
docs/push.md
16
docs/push.md
|
@ -1,5 +1,21 @@
|
|||
## 推送配置
|
||||
|
||||
### web推送
|
||||
> 适用于部署在服务器上或者家里有公网IP的设备上
|
||||
|
||||
配置config.yml的如下部分
|
||||
```yaml
|
||||
web:
|
||||
# 启用web
|
||||
enable: true
|
||||
# 监听的ip,若只需要本机访问则设置为127.0.0.1,监听本机所有ip为0.0.0.0
|
||||
host: 0.0.0.0
|
||||
# 监听的端口号 0-65535可选
|
||||
port: 8081
|
||||
```
|
||||
|
||||
开启后通过浏览器访问 *http://ip:port*即可打开网址
|
||||
|
||||
### 钉钉推送
|
||||
配置config.yml的如下部分,具体使用教程详情参考[钉钉](https://developers.dingtalk.com/document/robots/custom-robot-access?spm=ding_open_doc.document.0.0.7f875e5903iVpC#topic-2026027)
|
||||
```yaml
|
||||
|
|
|
@ -152,7 +152,6 @@ func (c *Core) RespondDaily(user *model.User, model string) {
|
|||
continue
|
||||
}
|
||||
if enabled {
|
||||
log.Infoln("检测到有答案未提交,将重新提交")
|
||||
err := btn.Click()
|
||||
if err != nil {
|
||||
log.Errorln("提交答案失败")
|
||||
|
@ -270,6 +269,7 @@ func (c *Core) RespondDaily(user *model.User, model string) {
|
|||
log.Errorln("获取网页全体内容失败" + err.Error())
|
||||
goto label
|
||||
}
|
||||
time.Sleep(time.Second * time.Duration(rand2.Intn(3)))
|
||||
log.Debugln("以获取网页内容")
|
||||
err = openTips.Click()
|
||||
if err != nil {
|
||||
|
|
|
@ -39,7 +39,7 @@ type User struct {
|
|||
func Query() ([]*User, error) {
|
||||
var users []*User
|
||||
ping()
|
||||
results, err := db.Query("select * from user")
|
||||
var results, err = db.Query("select * from user")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue