|
|
@@ -3,6 +3,7 @@ package flexible_employment |
|
|
|
import ( |
|
|
|
"bytes" |
|
|
|
"crypto/md5" |
|
|
|
"crypto/tls" |
|
|
|
"encoding/hex" |
|
|
|
"encoding/json" |
|
|
|
"fmt" |
|
|
@@ -22,7 +23,7 @@ type PuPiao struct { |
|
|
|
AppSecret string |
|
|
|
} |
|
|
|
|
|
|
|
const urlForPrd = "http://admin.linglong.net.cn" |
|
|
|
const urlForPrd = "https://admin.linglong.net.cn" |
|
|
|
const urlForDev = "http://api.testlg.cn" |
|
|
|
|
|
|
|
func NewPuPiao(appId, appSecret string) *PuPiao { |
|
|
@@ -106,7 +107,12 @@ func (gm *PuPiao) mergeMaps(map1, map2 map[string]interface{}) map[string]interf |
|
|
|
} |
|
|
|
|
|
|
|
func (gm *PuPiao) httpPostBody(url string, msg []byte) ([]byte, error) { |
|
|
|
resp, err := http.Post(url, "application/json;charset=utf-8", bytes.NewBuffer(msg)) |
|
|
|
client := &http.Client{ |
|
|
|
Transport: &http.Transport{ |
|
|
|
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, |
|
|
|
}, |
|
|
|
} |
|
|
|
resp, err := client.Post(url, "application/json;charset=utf-8", bytes.NewBuffer(msg)) |
|
|
|
if err != nil { |
|
|
|
return []byte(""), err |
|
|
|
} |
|
|
|