const system=require("../system");
const axios = require("axios");
class SmsClient{
    constructor(){
      this.smsTeml="http://123.57.156.109:4103/api/Send";
      this.restClient=system.getObject("util.restClient");
    }
    async sendMsg(to,content){
      var txtObj ={
            "appId":8,
            "mobilePhone":to,
            "content":content
      }
      let res = await axios({
        method: 'post',
        url: this.smsTeml,
        data: txtObj
      });
      // if (!res || !res.data || res.data.status != 0 || res.data.data.length == 0) {
      //   return system.getResult(null, `试算错误`);
      // }

      return res.data;
      // return this.restClient.execPost(txtObj,this.smsTeml);
    }
}
module.exports=SmsClient;
