From 89a79256b1ae8b56a316d86388dcd88be0c8b349 Mon Sep 17 00:00:00 2001 From: georgehao Date: Mon, 2 May 2022 14:09:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/notify_tpl.go | 12 ++++++------ views/notifytpl/add.html | 2 +- views/notifytpl/edit.html | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/controllers/notify_tpl.go b/controllers/notify_tpl.go index 95aaecb..d4df806 100644 --- a/controllers/notify_tpl.go +++ b/controllers/notify_tpl.go @@ -8,11 +8,11 @@ package controllers import ( + "encoding/json" + "github.com/astaxie/beego" "github.com/george518/PPGo_Job/models" "strings" "time" - "github.com/astaxie/beego" - "encoding/json" ) type NotifyTplController struct { @@ -85,6 +85,10 @@ func (self *NotifyTplController) AjaxSave() { notifyTpl.Content = strings.TrimSpace(self.GetString("content")) notifyTpl.Status, _ = self.GetInt("status") + if notifyTpl.Type == models.NotifyTplTypeSystem { + self.ajaxMsg("系统模板禁止更新", MSG_ERR) + } + if notifyTpl.TplType == 1 || notifyTpl.TplType == 2 || notifyTpl.TplType == 3 { m := make(map[string]string) err := json.Unmarshal([]byte(notifyTpl.Content), &m) @@ -93,10 +97,6 @@ func (self *NotifyTplController) AjaxSave() { } } - if notifyTpl.Type == models.NotifyTplTypeSystem { - self.ajaxMsg("系统模板禁止更新", MSG_ERR) - } - if err := notifyTpl.Update(); err != nil { self.ajaxMsg("更新失败,"+err.Error(), MSG_ERR) } diff --git a/views/notifytpl/add.html b/views/notifytpl/add.html index 4432b97..879e2c9 100644 --- a/views/notifytpl/add.html +++ b/views/notifytpl/add.html @@ -34,7 +34,7 @@
- +
diff --git a/views/notifytpl/edit.html b/views/notifytpl/edit.html
index db916e7..380d545 100644
--- a/views/notifytpl/edit.html
+++ b/views/notifytpl/edit.html
@@ -34,7 +34,7 @@
         
-