Browse Source

update service name

lijian 4 năm trước cách đây
mục cha
commit
9c23a699bf
1 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 4 3
      services/httpaccess/actions.go

+ 4 - 3
services/httpaccess/actions.go

@@ -10,6 +10,7 @@ import (
 	"sparrow/pkg/rpcs"
 	"sparrow/pkg/server"
 	"sparrow/pkg/token"
+	"strings"
 
 	"github.com/opentracing/opentracing-go/ext"
 
@@ -113,11 +114,11 @@ func AuthDevice(args DeviceAuthArgs, r render.Render) {
 	var hosts []string
 	switch args.Protocol {
 	case "http":
-		hosts, err = server.GetServerHosts(args.Protocol+"access", "httphost")
+		hosts, err = server.GetServerHosts(strings.ToUpper(args.Protocol)+"Access", "httphost")
 	case "mqtt":
-		hosts, err = server.GetServerHosts(args.Protocol+"access", "tcphost")
+		hosts, err = server.GetServerHosts(strings.ToUpper(args.Protocol)+"Access", "tcphost")
 	case "coap":
-		hosts, err = server.GetServerHosts(args.Protocol+"access", "udphost")
+		hosts, err = server.GetServerHosts(strings.ToUpper(args.Protocol)+"Access", "udphost")
 	default:
 		err = errors.New("unsuported protocol: " + args.Protocol)
 	}