Browse Source

feat: 更换短信

xuzhiheng 3 years ago
parent
commit
18687f1a42
1 changed files with 6 additions and 12 deletions
  1. 6 12
      src/front/front.go

+ 6 - 12
src/front/front.go

@@ -7,7 +7,6 @@ import (
 	"qfw/util/sms"
 	"regexp"
 	"strconv"
-	"strings"
 	"time"
 	. "util"
 
@@ -449,19 +448,14 @@ func SendPhoneCode(f *Front, phone string) {
 		log.Println("session1保存错误,验证码")
 	}
 	//发送短信
-	param := map[string]string{"code": s_ranNum}
-	log.Println("短信验证码", phone, s_ranNum, param)
-	SendSMS("2828060", phone, param)
+	// param := map[string]string{"code": s_ranNum}
+	log.Println("短信验证码", phone, s_ranNum)
+	// SendSMS("2828060", phone, param)
+	SendSMS("172.17.145.167:932", phone, s_ranNum)
 }
 
-//第三个参数是可变参数,可以传入多个,但要和模板相匹配
-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...)
 }
 
 func LoginCheck(f *Front, entId int, loginUser map[string]interface{}, userPhone string) {