|
@@ -55,6 +55,10 @@ type CrmApiUserResponse struct {
|
|
|
Data *CrmApiUserData `json:"data"`
|
|
|
}
|
|
|
|
|
|
+type CrmApiCodeResponse struct {
|
|
|
+ Code int `json:"code" comment:"返回码"`
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
type CrmApiUserData struct {
|
|
|
ContactInfo *CrmApiUserContactInfo `json:"contactInfo"`
|
|
@@ -74,16 +78,28 @@ func GetClptCrmWorkerRule(mobile string) (statusResp int, err error) {
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
- item := new(CrmApiUserResponse)
|
|
|
- err = json.Unmarshal(body, &item)
|
|
|
+
|
|
|
+
|
|
|
+ var responseCode CrmApiCodeResponse
|
|
|
+ err = json.Unmarshal(body, &responseCode)
|
|
|
if err != nil {
|
|
|
+ fmt.Println("JSON解析失败:", err)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- codeResp := item.Code
|
|
|
- if codeResp != 1 {
|
|
|
+ if responseCode.Code != 1 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ item := new(CrmApiUserResponse)
|
|
|
+ err = json.Unmarshal(body, &item)
|
|
|
+ if err != nil {
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
statusResp = item.Data.ContactInfo.Status
|
|
|
return
|
|
|
}
|