123456789101112131415161718192021222324252627282930 |
- package common
-
- import (
- "encoding/json"
- "gdyb/utils"
-
- )
-
- func GetPostDataWithMap(post map[string]interface{}) (string, error) {
- //json := jsoniter.Config{
- // MarshalFloatWith6Digits: true,
- // EscapeHTML: false,
- // SortMapKeys: true, //本身高灯平台仅要求对最外层json key进行asci码升序排序,但map是无序且随机的,所以签名和post数据均排序以保持一致
- // UseNumber: true,
- // DisallowUnknownFields: false,
- // CaseSensitive: true,
- //}.Froze()
-
- s, err := json.Marshal(&post)
- utils.ErrorLog("解析失败:%v", post)
- utils.ErrorLog("解析失败:%v", err)
- utils.ErrorLog("解析失败:%v",string(s))
-
- if err != nil {
- return "", err
- }
-
- return string(s), nil
- }
|