diff --git a/zero_buy/api.go b/zero_buy/api.go index 1caa21d..7c1aa94 100644 --- a/zero_buy/api.go +++ b/zero_buy/api.go @@ -9,11 +9,15 @@ import ( func ZeroBuyUrl(appSecret string, param map[string]string) string { url := "http://h5.hlpay178.cn/#/" param["deviceID"] = strings.ReplaceAll(param["deviceID"], " ", "") + deviceID, _ := php2go.URLDecode(param["deviceID"]) + if deviceID != "" { + param["deviceID"] = deviceID + } for k, v := range param { if strings.Contains(url, "?") == false { - url += "?" + k + "=" + v + url += "?" + k + "=" + php2go.URLEncode(v) } else { - url += "&" + k + "=" + v + url += "&" + k + "=" + php2go.URLEncode(v) } } sign := GetSign(appSecret, param)