|
@@ -43,7 +43,7 @@ func SmsSend(engine *xorm.Engine, args map[string]interface{}) error { |
|
|
return errors.New("短信不足") |
|
|
return errors.New("短信不足") |
|
|
} |
|
|
} |
|
|
if args["type"] != "mob" { //联江短信数量 |
|
|
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 { |
|
|
if err != nil { |
|
|
return err |
|
|
return err |
|
|
} |
|
|
} |
|
@@ -128,7 +128,7 @@ func SmsSend(engine *xorm.Engine, args map[string]interface{}) error { |
|
|
return nil |
|
|
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") |
|
|
smsmsgKey := offical.SysCfgByKey(engine, "smsmsg_key") |
|
|
smsmsgAccount := offical.SysCfgByKey(engine, "smsmsg_account") |
|
|
smsmsgAccount := offical.SysCfgByKey(engine, "smsmsg_account") |
|
|
smsWebHost := offical.SysCfgByKey(engine, "sms_web_host") |
|
|
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, ".", "/") |
|
|
thisUrl += strings.ReplaceAll(method, ".", "/") |
|
|
args["timestamp"] = zhios_third_party_utils.Int64ToStr(time.Now().Unix()) |
|
|
args["timestamp"] = zhios_third_party_utils.Int64ToStr(time.Now().Unix()) |
|
|
args["account"] = smsmsgAccount |
|
|
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) |
|
|
post, err := zhios_third_party_utils.CurlPost(thisUrl, zhios_third_party_utils.SerializeStr(args), nil) |
|
|
fmt.Println(string(post)) |
|
|
fmt.Println(string(post)) |
|
|
fmt.Println(err) |
|
|
fmt.Println(err) |
|
|