From 105c5c70aa6278819ee02daa85d2f4069e045641 Mon Sep 17 00:00:00 2001 From: cosmo Date: Thu, 21 Nov 2024 18:12:48 +0800 Subject: [PATCH] beta505 --- main.go | 2 +- structs/structs.go | 1 + template/config_template.go | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 9dcd3d83..12f27415 100644 --- a/main.go +++ b/main.go @@ -458,7 +458,7 @@ func main() { r.POST("/uploadpicv3", server.UploadBase64ImageHandlerV3(rateLimiter, api)) r.POST("/uploadrecord", server.UploadBase64RecordHandler(rateLimiter)) // 使用 CreateHandleValidation,传入 WebhookHandler 实例 - r.POST("/webhook", server.CreateHandleValidation(conf.Settings.ClientSecret, webhookHandler)) + r.POST("/"+conf.Settings.WebhookPath, server.CreateHandleValidation(conf.Settings.ClientSecret, webhookHandler)) r.Static("/channel_temp", "./channel_temp") if config.GetFrpPort() == "0" && !config.GetDisableWebui() { //webui和它的api diff --git a/structs/structs.go b/structs/structs.go index 58624200..5388850d 100644 --- a/structs/structs.go +++ b/structs/structs.go @@ -70,6 +70,7 @@ type Settings struct { Crt string `yaml:"crt"` Key string `yaml:"key"` UseSelfCrt bool `yaml:"use_self_crt"` + WebhookPath string `yaml:"webhook_path"` //日志类 DeveloperLog bool `yaml:"developer_log"` LogLevel int `yaml:"log_level"` diff --git a/template/config_template.go b/template/config_template.go index 56064b5b..b22ad122 100644 --- a/template/config_template.go +++ b/template/config_template.go @@ -85,6 +85,7 @@ settings: identify_appids : [] #默认不需要设置,完成SSL配置类+server_dir设置为域名+完成备案+ssl全套设置后,若有多个机器人需要过域名校验(自己名下)可设置,格式为,整数appid,组成的数组 crt : "" #证书路径 从你的域名服务商或云服务商申请签发SSL证书(qq要求SSL) key : "" #密钥路径 Apache(crt文件、key文件)示例: "C:\\123.key" \需要双写成\\ + webhook_path : "webhook" #webhook监听的地址,默认\webhook #日志类 developer_log : false #开启开发者日志 默认关闭