Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
sdvdxl committed Jun 10, 2017
1 parent b5288e1 commit e4d834f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"errors"
"log"
"net/http"
"strings"
"time"

Expand Down Expand Up @@ -60,7 +61,13 @@ func main() {
api.POST("/message", func(c echo.Context) error {
log.Println("message comming")
tos := c.FormValue("tos")
content := util.HandleContent(c.FormValue("content"))
content := c.FormValue("content")
log.Println("tos:", tos, " content:", content)
if content == "" {
return echo.NewHTTPError(http.StatusBadRequest, "content is requied")
}

content = util.HandleContent(content)
if strings.HasPrefix(tos, IMDingPrefix) { //是钉钉
token := tos[len(IMDingPrefix):]
if cfg.DingTalk.Enable {
Expand Down

0 comments on commit e4d834f

Please sign in to comment.