Commit 33abea4a by 孙龙

up

parent 21883dde
Showing with 2 additions and 3 deletions
...@@ -3,7 +3,6 @@ package crm ...@@ -3,7 +3,6 @@ package crm
import ( import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt"
"github.com/tidwall/gjson" "github.com/tidwall/gjson"
"golang-asynctask/util/lib" "golang-asynctask/util/lib"
"net/http" "net/http"
...@@ -21,7 +20,7 @@ type comUser struct { ...@@ -21,7 +20,7 @@ type comUser struct {
func PushComUserInfoToErp(data string) (err error){ func PushComUserInfoToErp(data string) (err error){
pushData := &comUser{} pushData := &comUser{}
err = nil
err = json.Unmarshal([]byte(data),pushData) err = json.Unmarshal([]byte(data),pushData)
if err != nil{ if err != nil{
return return
...@@ -44,7 +43,7 @@ func PushComUserInfoToErp(data string) (err error){ ...@@ -44,7 +43,7 @@ func PushComUserInfoToErp(data string) (err error){
header.Set("Content-Type","application/json") header.Set("Content-Type","application/json")
push_url := cfg.Instance("config").GetString("pushErpDomain") push_url := cfg.Instance("config").GetString("pushErpDomain")
response,returnData,err := lib.HttpPOST(push_url,urlParams,0,header,"") response,returnData,err := lib.HttpPOST(push_url,urlParams,0,header,"")
fmt.Println(response,string(returnData),err) //fmt.Println(response,string(returnData),err)
if err == nil && response.StatusCode == 200{ if err == nil && response.StatusCode == 200{
err_code := gjson.Parse(string(returnData)).Get("errcode").Int() err_code := gjson.Parse(string(returnData)).Get("errcode").Int()
msg := gjson.Parse(string(returnData)).Get("errmsg").String() msg := gjson.Parse(string(returnData)).Get("errmsg").String()
......
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