|
@ -2,6 +2,7 @@ package helper |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"errors" |
|
|
"errors" |
|
|
|
|
|
"net/url" |
|
|
"sort" |
|
|
"sort" |
|
|
"strings" |
|
|
"strings" |
|
|
) |
|
|
) |
|
@ -121,7 +122,7 @@ func HttpBuildQuery(data map[string]string) string { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 对map进行拼接 |
|
|
|
|
|
|
|
|
* 对map字典按照顺序进行拼接,并且把每个value进行类urlencode |
|
|
* @param data map[string]string |
|
|
* @param data map[string]string |
|
|
* @2021/10/14 |
|
|
* @2021/10/14 |
|
|
* @wyy |
|
|
* @wyy |
|
@ -139,7 +140,7 @@ func HttpBuildStringQuery(data map[string]string) string { |
|
|
|
|
|
|
|
|
for _, value := range keySlice { |
|
|
for _, value := range keySlice { |
|
|
if value != "" && data[value] != "" { |
|
|
if value != "" && data[value] != "" { |
|
|
query += StringJoin(value, "=", data[value], "&") |
|
|
|
|
|
|
|
|
query += StringJoin(value, "=", url.QueryEscape(data[value]), "&") |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|