|
@@ -246,13 +246,17 @@ func Code(context *admin.Context) (interface{}, error) {
|
|
|
|
|
|
//根据模板发送短信,模板是运营商设定的。
|
|
|
//第三个参数是可变参数,可以传入多个,但要和模板相匹配
|
|
|
-func SendSMS(tplcode /*模板代码*/, mobile /*手机号码*/ string, param map[string]string) {
|
|
|
- tmp := []string{}
|
|
|
- for k, v := range param {
|
|
|
- tmp = append(tmp, "#"+k+"#="+v)
|
|
|
- }
|
|
|
- text := strings.Join(tmp, "&")
|
|
|
- sms.SendSms(mobile, tplcode, text)
|
|
|
+//func SendSMS(tplcode /*模板代码*/, mobile /*手机号码*/ string, param map[string]string) {
|
|
|
+// tmp := []string{}
|
|
|
+// for k, v := range param {
|
|
|
+// tmp = append(tmp, "#"+k+"#="+v)
|
|
|
+// }
|
|
|
+// text := strings.Join(tmp, "&")
|
|
|
+// sms.SendSms(mobile, tplcode, text)
|
|
|
+//}
|
|
|
+
|
|
|
+func SendSMS(address, mobile string, params ...string) {
|
|
|
+ sms.SendSms(address, "01", mobile, params...)
|
|
|
}
|
|
|
|
|
|
//发送验证码
|
|
@@ -279,8 +283,8 @@ func SendPhoneIdentCode(context *admin.Context, phone string) bool {
|
|
|
log.Println("session1保存错误,验证码")
|
|
|
}
|
|
|
//发送短信
|
|
|
- param := map[string]string{"code": s_ranNum}
|
|
|
+ //param := map[string]string{"code": s_ranNum}
|
|
|
log.Println("短信验证码", phone, s_ranNum)
|
|
|
- SendSMS("2828060", phone, param)
|
|
|
+ SendSMS(SysConfigs.SmsServiceRpc, phone, s_ranNum)
|
|
|
return true
|
|
|
}
|