钉钉模板提交格式检测

This commit is contained in:
linxiaozhi
2019-03-23 20:40:49 +08:00
parent f1b35a9a25
commit fab467f4ec
2 changed files with 2 additions and 11 deletions

View File

@@ -59,7 +59,7 @@ func (self *NotifyTplController) AjaxSave() {
notifyTpl.Type = models.NotifyTplTypeDefault notifyTpl.Type = models.NotifyTplTypeDefault
notifyTpl.Status, _ = self.GetInt("status") notifyTpl.Status, _ = self.GetInt("status")
if notifyTpl.TplType == 1 || notifyTpl.TplType == 3 { if notifyTpl.TplType == 1 || notifyTpl.TplType == 2 || notifyTpl.TplType == 3 {
m := make(map[string]string) m := make(map[string]string)
err := json.Unmarshal([]byte(notifyTpl.Content), &m) err := json.Unmarshal([]byte(notifyTpl.Content), &m)
if err != nil { if err != nil {
@@ -85,7 +85,7 @@ func (self *NotifyTplController) AjaxSave() {
notifyTpl.Content = strings.TrimSpace(self.GetString("content")) notifyTpl.Content = strings.TrimSpace(self.GetString("content"))
notifyTpl.Status, _ = self.GetInt("status") notifyTpl.Status, _ = self.GetInt("status")
if notifyTpl.TplType == 1 || notifyTpl.TplType == 3 { if notifyTpl.TplType == 1 || notifyTpl.TplType == 2 || notifyTpl.TplType == 3 {
m := make(map[string]string) m := make(map[string]string)
err := json.Unmarshal([]byte(notifyTpl.Content), &m) err := json.Unmarshal([]byte(notifyTpl.Content), &m)
if err != nil { if err != nil {

View File

@@ -17,15 +17,6 @@ import (
"bytes" "bytes"
) )
type Msg struct {
MsgType string `json:"msgtype"`
Text *Text `json:"text"`
}
type Text struct {
Content string `json:"content"`
}
type Dingtalk struct { type Dingtalk struct {
Dingtalks map[string]string Dingtalks map[string]string
Content map[string]interface{} Content map[string]interface{}