From dfed18fe60e5ae5f57e4d2762971a4b1967f683d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=96=87=E9=9D=99?= <1319697849@qq.com> Date: Wed, 25 Jun 2025 10:18:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0AppKey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/config.yaml | 1 + pkg/consul/register.go | 1 + router/router.go | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/config.yaml b/conf/config.yaml index 62a70e7..ef51fd4 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -8,6 +8,7 @@ Server: Interval: 10 #健康检查间隔,单位:秒 Deregister: 1 #注销时间,相当于过期时间,单位:分钟 UriPath: /semantic/unisoundc2c/speech-nlu-parse + AppKey: 391b50b5ed634fc49a3db7cfd6bc40db RabbitMq: Url: amqp://iot:qwe!23@172.28.124.106:5672/voice diff --git a/pkg/consul/register.go b/pkg/consul/register.go index f708ad2..e9ea84e 100644 --- a/pkg/consul/register.go +++ b/pkg/consul/register.go @@ -19,6 +19,7 @@ type ConsulSettingS struct { Interval time.Duration Deregister time.Duration UriPath string + AppKey string } func RegisterService(cs *ConsulSettingS) error { diff --git a/router/router.go b/router/router.go index 666e399..4ecfd07 100644 --- a/router/router.go +++ b/router/router.go @@ -92,7 +92,7 @@ func SpeechNluParseSemanticRequest(req SnpReq) *model.SemanticReq { // 校验AppKey func VerifyAppKeyMiddleware() gin.HandlerFunc { validAppKeys := map[string]bool{ - "391b50b5ed634fc49a3db7cfd6bc40db": true, + global.ServerSetting.AppKey: true, } return func(c *gin.Context) { -- GitLab