From 333c8b7b25d17e5bf3937c60ecb93fb9a1165c30 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 28 Jun 2023 17:55:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zero_buy/api.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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)