|
- package playlet_kujiang
-
- import (
- "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/comm"
- zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
- "fmt"
- "github.com/syyongx/php2go"
- "strings"
- )
-
- func SendPost(method string, token string, param map[string]string) (string, error) {
- url := "https://api.dpxkjw.com/" + method
- arr := map[string]string{
- "timestamp": param["timestamp"],
- "apiKey": param["apiKey"],
- }
- param["sign"] = GetSign(arr, token)
- get, err := zhios_third_party_utils.CurlPost(url, param, nil)
- fmt.Println(string(get))
- fmt.Println(err)
- return string(get), err
- }
- func GetSign(param map[string]string, signSecret string) string {
- str := ""
- keys := comm.KsortToStr(param)
- for _, k := range keys {
- str += param[k]
-
- }
- str += signSecret
- return strings.ToUpper(php2go.Md5(str))
- }
|