|
@@ -163,7 +163,7 @@ func SendSMS(tplcode /*模板代码*/, mobile /*手机号码*/ string, param map
|
|
|
|
|
|
//发送验证码
|
|
|
func SendPhoneIdentCode(phone string, session *httpsession.Session) bool {
|
|
|
- lastSentTime, _ := session.Get("identCodeTime").(int64)
|
|
|
+ lastSentTime := util.Int64All(session.Get("identCodeTime"))
|
|
|
//60秒之内不允许重复发
|
|
|
if lastSentTime > 0 && time.Now().Unix()-lastSentTime <= 60 {
|
|
|
return false
|
|
@@ -182,8 +182,8 @@ func SendPhoneIdentCode(phone string, session *httpsession.Session) bool {
|
|
|
|
|
|
//短信验证码校验
|
|
|
func CheckPhoneIdent(session *httpsession.Session, code string) string {
|
|
|
- identCodeKey, _ := session.Get("identCodeValue").(string)
|
|
|
- if identCodeKey != "" && identCodeKey == code {
|
|
|
+ identCodeValue, _ := session.Get("identCodeValue").(string)
|
|
|
+ if identCodeValue != "" && identCodeValue == code {
|
|
|
identCodeKey, _ := session.Get("identCodeKey").(string)
|
|
|
ClearPhoneIdentSession(session)
|
|
|
return identCodeKey
|