更新uri模版生成

This commit is contained in:
白茶清欢 2021-07-26 15:39:06 +08:00
parent 0b64b70e9d
commit 2af054db74

View File

@ -66,7 +66,7 @@ func BuildURL(uriConfig *URIConfig, parameter map[string]interface{}) (string, m
finalParameter := make(map[string]interface{})
for field, val := range parameter {
if strings.Contains(uri, uriConfig.Left+field+uriConfig.Right) {
uri = strings.ReplaceAll(uri, "{"+field+"}", fmt.Sprintf("%v", val))
uri = strings.ReplaceAll(uri, uriConfig.Left+field+uriConfig.Right, fmt.Sprintf("%v", val))
if uriConfig.RemoveURIParam {
continue
}