优化页面

This commit is contained in:
georgehao
2022-05-02 14:09:45 +08:00
parent 60196f512b
commit 89a79256b1
3 changed files with 8 additions and 8 deletions

View File

@@ -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)
}