Commit 3808dcb6 by 朱继来

temp1

parent 6d5c2e0d
...@@ -7,8 +7,14 @@ import ( ...@@ -7,8 +7,14 @@ import (
"net/http" "net/http"
"encoding/json" "encoding/json"
"strings" "strings"
"io/ioutil"
) )
type JosnResp struct {
err_code string `json:"err_code"`
msg string `json:"msg"`
}
func SendPurchaseEmail(data string) (err error) { func SendPurchaseEmail(data string) (err error) {
crm_url := util.Configs.Crm_domain.SendMailUrl // CRM发送邮件接口 crm_url := util.Configs.Crm_domain.SendMailUrl // CRM发送邮件接口
...@@ -22,12 +28,25 @@ func SendPurchaseEmail(data string) (err error) { ...@@ -22,12 +28,25 @@ func SendPurchaseEmail(data string) (err error) {
req.Header.Set("Content-Type", "application/json") req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req) resp, err := client.Do(req)
fmt.Println(resp.Body)
defer resp.Body.Close()
if err != nil { if err != nil {
fmt.Println(err.Error()) fmt.Println(err.Error())
} }
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
res := &JosnResp{}
defer resp.Body.Close() err1 := json.Unmarshal(body, res)
if err1 !=nil{
fmt.Println(err1)
}
fmt.Println(res)
return return
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment