修改健康包 多点执业的判断

This commit is contained in:
2024-06-17 14:37:54 +08:00
parent c3bafbb11c
commit 0de58be7ef
3 changed files with 88 additions and 46 deletions
-46
View File
@@ -58,52 +58,6 @@ func getRequestUrlParams(userId string) (bool, string) {
return true, queryString
}
//
// // 统一请求
// func postRequest(url string, requestBody []byte) (map[string]interface{}, error) {
// responseMap := make(map[string]interface{})
//
// // 发起 POST 请求
// resp, err := http.Post(url, "application/json", bytes.NewBuffer(requestBody))
// if err != nil {
// return nil, err
// }
//
// defer func(Body io.ReadCloser) {
// _ = Body.Close()
// }(resp.Body)
//
// body, err := io.ReadAll(resp.Body)
// if err != nil {
// return nil, err
// }
//
// err = json.Unmarshal([]byte(string(body)), &responseMap)
// if err != nil {
// // json解析失败
// return nil, err
// }
//
// if responseMap == nil {
// return nil, errors.New("请求im失败")
// }
//
// if _, ok := responseMap["ErrorCode"]; ok {
// errorCode := responseMap["ErrorCode"].(int)
// if errorCode != 0 {
// if errorInfo, ok := responseMap["ErrorInfo"].(string); ok {
// return nil, errors.New(errorInfo)
// } else {
// return nil, errors.New("请求im失败")
// }
// }
// } else {
// return nil, errors.New("请求im失败")
// }
//
// return responseMap, nil
// }
// 统一请求
func postRequest(url string, requestBody []byte) (*responseData, error) {
var responseData responseData