diff --git a/conf/config.yaml b/conf/config.yaml index 62a70e747d6760e4656326d7398f123a82b24f4f..ef51fd4c667bbf7c5ff97900d674332fe4b770d6 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 f708ad27e271ce24bfcdadbc198572896b038d42..e9ea84e04fef342949a6fa9b576b887b6d979410 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 666e399fef8dce47c825c2c0ae2011040152c30c..4ecfd07d190331e738e29c705e0723214bc4a373 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) {