|
@@ -2,6 +2,7 @@ package service
|
|
|
|
|
|
import (
|
|
import (
|
|
. "app.yhyue.com/moapp/jybase/api"
|
|
. "app.yhyue.com/moapp/jybase/api"
|
|
|
|
+ "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
|
|
"encoding/json"
|
|
"encoding/json"
|
|
"fmt"
|
|
"fmt"
|
|
"jy/src/jfw/modules/subscribepay/src/config"
|
|
"jy/src/jfw/modules/subscribepay/src/config"
|
|
@@ -104,7 +105,7 @@ func (e *EquityCode) Submit() {
|
|
} else if reqType == 2 {
|
|
} else if reqType == 2 {
|
|
sessVal := e.Session().GetMultiple()
|
|
sessVal := e.Session().GetMultiple()
|
|
phone := qutil.ObjToString(sessVal["identCodeKey"])
|
|
phone := qutil.ObjToString(sessVal["identCodeKey"])
|
|
- if jy.CheckPhoneIdent(e.Session(), e.GetString("identCode")) == "" { //验证码不正确
|
|
|
|
|
|
+ if CheckPhoneIdentNotClear(e.Session(), e.GetString("identCode")) == "" { //验证码不正确
|
|
return -1 //短信验证码错误
|
|
return -1 //短信验证码错误
|
|
}
|
|
}
|
|
equityCode := e.GetString("equityCode")
|
|
equityCode := e.GetString("equityCode")
|
|
@@ -143,6 +144,7 @@ func (e *EquityCode) Submit() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ jy.ClearPhoneIdentSession(e.Session(), e.GetString("identCode"))
|
|
disChannel := "x045"
|
|
disChannel := "x045"
|
|
items := util.ActivityMysql.SelectBySql(`select item_code from jianyu.dict_item where parent_code='x04' and item_name=?`, qutil.ObjToString((*datas)[0]["eName"]))
|
|
items := util.ActivityMysql.SelectBySql(`select item_code from jianyu.dict_item where parent_code='x04' and item_name=?`, qutil.ObjToString((*datas)[0]["eName"]))
|
|
if items != nil && len(*items) > 0 {
|
|
if items != nil && len(*items) > 0 {
|
|
@@ -247,3 +249,27 @@ func (e *EquityCode) Captcha() error {
|
|
w.Header().Set("Content-Type", "image/png")
|
|
w.Header().Set("Content-Type", "image/png")
|
|
return captcha.WriteImage(w, id, 90, 30)
|
|
return captcha.WriteImage(w, id, 90, 30)
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+const (
|
|
|
|
+ defaultPhoneFlag = "identCode"
|
|
|
|
+ ExperienceSign = "EXPERIENCESIGN"
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+// 短信验证码校验 不清除
|
|
|
|
+func CheckPhoneIdentNotClear(session *httpsession.Session, code string, sessionKey ...string) string {
|
|
|
|
+ sessionKeyFlag := defaultPhoneFlag
|
|
|
|
+ if len(sessionKey) > 0 && sessionKey[0] != "" {
|
|
|
|
+ sessionKeyFlag = sessionKey[0]
|
|
|
|
+ }
|
|
|
|
+ lastSentTime := qutil.Int64All(session.Get(fmt.Sprintf("%sTime", sessionKeyFlag)))
|
|
|
|
+ // 是否超过三分钟
|
|
|
|
+ if lastSentTime < 0 || time.Now().Unix()-lastSentTime > 300 {
|
|
|
|
+ return ""
|
|
|
|
+ }
|
|
|
|
+ identCodeValue, _ := session.Get(fmt.Sprintf("%sValue", sessionKeyFlag)).(string)
|
|
|
|
+ if identCodeValue != "" && identCodeValue == code {
|
|
|
|
+ identCodeKey, _ := session.Get(fmt.Sprintf("%sKey", sessionKeyFlag)).(string)
|
|
|
|
+ return identCodeKey
|
|
|
|
+ }
|
|
|
|
+ return ""
|
|
|
|
+}
|