feat: 添加/修改通知方式时可选择不发送测试信息

This commit is contained in:
Akkia
2022-04-23 02:07:46 +08:00
parent 213b2ee2e3
commit 7d03da21f3
3 changed files with 14 additions and 1 deletions

View File

@@ -395,6 +395,7 @@ type notificationForm struct {
RequestHeader string
RequestBody string
VerifySSL string
SkipCheck string
}
func (ma *memberAPI) addOrEditNotification(c *gin.Context) {
@@ -416,7 +417,12 @@ func (ma *memberAPI) addOrEditNotification(c *gin.Context) {
Notification: &n,
Server: nil,
}
err = ns.Send("这是测试消息")
// 勾选了跳过检查
if nf.SkipCheck == "on" {
err = nil
} else {
err = ns.Send("这是测试消息")
}
}
if err == nil {
// 保证Tag不为空