wangkaiyue vor 6 Jahren
Ursprung
Commit
a725718cea
1 geänderte Dateien mit 7 neuen und 6 gelöschten Zeilen
  1. 7 6
      core/src/qfw/manage/message.go

+ 7 - 6
core/src/qfw/manage/message.go

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