|
@@ -2,6 +2,7 @@ package oilrtx
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
"encoding/json"
|
|
"encoding/json"
|
|
|
|
|
+ "fmt"
|
|
|
"io/ioutil"
|
|
"io/ioutil"
|
|
|
"log"
|
|
"log"
|
|
|
"net/http"
|
|
"net/http"
|
|
@@ -162,10 +163,12 @@ func (s *RtxService) HandleSendMsg(username string, tomobile string, message str
|
|
|
|
|
|
|
|
json, err := json.Marshal(msg)
|
|
json, err := json.Marshal(msg)
|
|
|
params := string(json)
|
|
params := string(json)
|
|
|
-
|
|
|
|
|
|
|
+ fmt.Sprintf(params, "短信=====")
|
|
|
|
|
+ params1 := "{\"UserName\":\"" + msg.UserName + "\",\"ToMobile\":\"" + msg.ToMobile + "\",\"MSG\":\"" + msg.Msg +"\"}"
|
|
|
|
|
+ fmt.Println(params1)
|
|
|
req, err := http.NewRequest("post", "http://api.uidp.dgyt.petrochina/SMS/API/sendSMS", strings.NewReader(params))
|
|
req, err := http.NewRequest("post", "http://api.uidp.dgyt.petrochina/SMS/API/sendSMS", strings.NewReader(params))
|
|
|
req.Header.Add("Content-Type", "application/json")
|
|
req.Header.Add("Content-Type", "application/json")
|
|
|
- req.Header.Add("X-Token", "rzkTZhCbQKLFUOJI5L7VEqjsUWF+PoaewKQbvJHYo2Nimtn+fEWBne7G7JbWF3fpdJnAUN3e1pQ=")
|
|
|
|
|
|
|
+ req.Header.Add("X-Token", "/LT6VRmkY8mpGHJzWMKxzMQhjbkXwAHsk0zJkRfAPtjC0Wsecn1539xiULbJU32D59Kh0jTuUD0=")
|
|
|
|
|
|
|
|
resp, err := client.Do(req)
|
|
resp, err := client.Do(req)
|
|
|
if err != nil {
|
|
if err != nil {
|