wangbo 5 meses atrás
pai
commit
d27f90a794
1 arquivos alterados com 6 adições e 0 exclusões
  1. 6 0
      ng_cws_client/ng_cws_client.go

+ 6 - 0
ng_cws_client/ng_cws_client.go

@@ -9,6 +9,7 @@ import (
 	"git.sxidc.com/service-supports/cws-sdk/utils"
 	"git.sxidc.com/service-supports/cws-sdk/utils/http_client"
 	"git.sxidc.com/service-supports/cws-sdk/utils/request_util"
+	"strings"
 	"time"
 )
 
@@ -23,6 +24,11 @@ func Init(url string, timeout time.Duration) error {
 
 	NGCwsClient = http_client.New()
 	cwsTimeOut = timeout
+	//判断是否有 /
+	if !strings.HasSuffix(url, "/") {
+		url = url + "/"
+	}
+
 	cwsUrl = url
 	return nil
 }