Commit dfed18fe authored by 赵文静's avatar 赵文静

增加AppKey

parent a4b760ec
...@@ -8,6 +8,7 @@ Server: ...@@ -8,6 +8,7 @@ Server:
Interval: 10 #健康检查间隔,单位:秒 Interval: 10 #健康检查间隔,单位:秒
Deregister: 1 #注销时间,相当于过期时间,单位:分钟 Deregister: 1 #注销时间,相当于过期时间,单位:分钟
UriPath: /semantic/unisoundc2c/speech-nlu-parse UriPath: /semantic/unisoundc2c/speech-nlu-parse
AppKey: 391b50b5ed634fc49a3db7cfd6bc40db
RabbitMq: RabbitMq:
Url: amqp://iot:qwe!23@172.28.124.106:5672/voice Url: amqp://iot:qwe!23@172.28.124.106:5672/voice
......
...@@ -19,6 +19,7 @@ type ConsulSettingS struct { ...@@ -19,6 +19,7 @@ type ConsulSettingS struct {
Interval time.Duration Interval time.Duration
Deregister time.Duration Deregister time.Duration
UriPath string UriPath string
AppKey string
} }
func RegisterService(cs *ConsulSettingS) error { func RegisterService(cs *ConsulSettingS) error {
......
...@@ -92,7 +92,7 @@ func SpeechNluParseSemanticRequest(req SnpReq) *model.SemanticReq { ...@@ -92,7 +92,7 @@ func SpeechNluParseSemanticRequest(req SnpReq) *model.SemanticReq {
// 校验AppKey // 校验AppKey
func VerifyAppKeyMiddleware() gin.HandlerFunc { func VerifyAppKeyMiddleware() gin.HandlerFunc {
validAppKeys := map[string]bool{ validAppKeys := map[string]bool{
"391b50b5ed634fc49a3db7cfd6bc40db": true, global.ServerSetting.AppKey: true,
} }
return func(c *gin.Context) { return func(c *gin.Context) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment