Browse Source

短信api

master
huangjiajun 1 year ago
parent
commit
e321c96b26
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      sms/api.go

+ 3
- 3
sms/api.go View File

@@ -43,7 +43,7 @@ func SmsSend(engine *xorm.Engine, args map[string]interface{}) error {
return errors.New("短信不足")
}
if args["type"] != "mob" { //联江短信数量
send, err := SmsApiSend(engine, "api.v1.accountNum", map[string]string{})
send, err := SmsApiSend(engine, "api.v1.accountNum", map[string]interface{}{})
if err != nil {
return err
}
@@ -128,7 +128,7 @@ func SmsSend(engine *xorm.Engine, args map[string]interface{}) error {
return nil
}

func SmsApiSend(engine *xorm.Engine, method string, args map[string]string) (string, error) {
func SmsApiSend(engine *xorm.Engine, method string, args map[string]interface{}) (string, error) {
smsmsgKey := offical.SysCfgByKey(engine, "smsmsg_key")
smsmsgAccount := offical.SysCfgByKey(engine, "smsmsg_account")
smsWebHost := offical.SysCfgByKey(engine, "sms_web_host")
@@ -146,7 +146,7 @@ func SmsApiSend(engine *xorm.Engine, method string, args map[string]string) (str
thisUrl += strings.ReplaceAll(method, ".", "/")
args["timestamp"] = zhios_third_party_utils.Int64ToStr(time.Now().Unix())
args["account"] = smsmsgAccount
args["key"] = php2go.Md5(smsmsgKey + php2go.Md5(args["timestamp"]))
args["key"] = php2go.Md5(smsmsgKey + php2go.Md5(args["timestamp"].(string)))
post, err := zhios_third_party_utils.CurlPost(thisUrl, zhios_third_party_utils.SerializeStr(args), nil)
fmt.Println(string(post))
fmt.Println(err)


Loading…
Cancel
Save