瀏覽代碼

修改消息发送模式

longyu 2 年之前
父節點
當前提交
56cf62b437
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      controllers/alaram_msg.go

+ 5 - 3
controllers/alaram_msg.go

@@ -49,9 +49,11 @@ func (this *AlarmMsgController) SmsSend() {
 	}
 	//邮箱
 	{
-		configItem, _ := cache.GetSmsConfigByCache("email")
-		if configItem != nil {
-			go services.SendAlarmMsgByEmail(req.ProjectName, req.RunMode, req.MsgBody, configItem.ConfigValue, req.Level)
+		if utils.RunMode == "release" {
+			configItem, _ := cache.GetSmsConfigByCache("email")
+			if configItem != nil {
+				go services.SendAlarmMsgByEmail(req.ProjectName, req.RunMode, req.MsgBody, configItem.ConfigValue, req.Level)
+			}
 		}
 	}
 	br.Ret = 200