|
|
@ -1,6 +1,7 @@ |
|
|
|
package wechat |
|
|
|
|
|
|
|
import ( |
|
|
|
"bytes" |
|
|
|
"encoding/base64" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
@ -49,13 +50,19 @@ func GetMiniappQrcode(access_token string, qrcodeParamsMap map[string]interface{ |
|
|
|
"auto_color": autoColor, |
|
|
|
"is_hyaline": isHyaline, |
|
|
|
} |
|
|
|
requestDataJson, err := json.Marshal(requestData) |
|
|
|
// json.marshal 会转义&字符
|
|
|
|
/*requestDataJson, err := json.Marshal(requestData) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
return "", err |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
bf := bytes.NewBuffer([]byte{}) |
|
|
|
jsonEncoder := json.NewEncoder(bf) |
|
|
|
jsonEncoder.SetEscapeHTML(false) |
|
|
|
jsonEncoder.Encode(requestData) |
|
|
|
|
|
|
|
response, err := PostJson(getCodeUrl, requestDataJson) |
|
|
|
response, err := PostJson(getCodeUrl, bf.Bytes()) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
return "", err |
|
|
|