|
@@ -158,9 +158,9 @@ func (m *Message) Sase() error {
|
|
|
data["i_click"], _ = m.GetInteger("click")
|
|
|
data["s_sender"] = m.GetSession("loginName")
|
|
|
|
|
|
- titleFlag := false
|
|
|
+ mtype := "message"
|
|
|
if util.ObjToString(m.GetString("showTitle")) == "T" { //点击通知 使用客户端带title
|
|
|
- titleFlag = true
|
|
|
+ mtype = "titleMessage"
|
|
|
}
|
|
|
data["l_submitdate"] = time.Now().Unix()
|
|
|
id := Save("message_app", data)
|
|
@@ -171,7 +171,7 @@ func (m *Message) Sase() error {
|
|
|
if len([]rune(subtitle)) > 80 {
|
|
|
subtitle = string([]rune(subtitle)[:80]) + "..."
|
|
|
}
|
|
|
- go sendMes(id, title, subtitle, m.GetString("url"), pic, titleFlag)
|
|
|
+ go sendMes(id, title, subtitle, m.GetString("url"), pic, mtype)
|
|
|
// jpushid := "18171adc035c24ee76e"
|
|
|
// openid := "ocXeA0juxw7b7A_bjXVy0NSJF5f0"
|
|
|
// jgpush.JgpushD_Nc(subtitle, "message", []string{jpushid}, map[string]interface{}{
|
|
@@ -190,7 +190,7 @@ func (m *Message) Sase() error {
|
|
|
}
|
|
|
|
|
|
//
|
|
|
-func sendMes(id, title, subtitle, url, pic string, titleFlag bool) error {
|
|
|
+func sendMes(id, title, subtitle, url, pic, mtype string) error {
|
|
|
defer util.Catch()
|
|
|
if id == "" {
|
|
|
log.Println("id 是空的!")
|
|
@@ -268,13 +268,12 @@ func sendMes(id, title, subtitle, url, pic string, titleFlag bool) error {
|
|
|
"jgPushId": jpushid,
|
|
|
"url": url + "==" + id,
|
|
|
"userId": _id,
|
|
|
- "type": "message",
|
|
|
+ "type": mtype,
|
|
|
"content": pic,
|
|
|
"descript": subtitle,
|
|
|
"title": title,
|
|
|
"extend": map[string]interface{}{
|
|
|
- "s_id": id,
|
|
|
- "withtitle": titleFlag,
|
|
|
+ "s_id": id,
|
|
|
},
|
|
|
})
|
|
|
}()
|