|
@@ -67,7 +67,7 @@ func (c *CaptchaStruct) Get() {
|
|
|
if count == 1 {
|
|
|
//直接发短信
|
|
|
jy.SendPhoneIdentCode(c.Request, config.Config.SmsServiceRpc, phone, c.Session())
|
|
|
- go SendCodeByWUrl(c.Session(), "identCode", phone)
|
|
|
+ go SendCodeByWUrl(c.Session(), "identCode", phone, 1)
|
|
|
res.Data = map[string]interface{}{
|
|
|
"code": 0, //已发送短信验证码
|
|
|
}
|
|
@@ -150,7 +150,7 @@ func (c *CaptchaStruct) Check() {
|
|
|
notSendFlag := c.GetString("notSend")
|
|
|
if notSendFlag == "" {
|
|
|
jy.SendPhoneIdentCode(c.Request, config.Config.SmsServiceRpc, phone, c.Session(), fmt.Sprintf(captcha.SendCodeKey, capt.Key, phone))
|
|
|
- go SendCodeByWUrl(c.Session(), capt.Key, phone)
|
|
|
+ go SendCodeByWUrl(c.Session(), capt.Key, phone, 2)
|
|
|
res.Data = map[string]interface{}{
|
|
|
"code": 0, //已发送短信验证码
|
|
|
}
|
|
@@ -160,8 +160,13 @@ func (c *CaptchaStruct) Check() {
|
|
|
c.ServeJson(r)
|
|
|
}
|
|
|
|
|
|
-func SendCodeByWUrl(sess *httpsession.Session, captKey, phone string) {
|
|
|
+func SendCodeByWUrl(sess *httpsession.Session, captKey, phone string, mold int) {
|
|
|
key := fmt.Sprintf(captcha.SendCodeKey, captKey, phone)
|
|
|
+ if mold == 1 {
|
|
|
+ key = captKey
|
|
|
+ }
|
|
|
value := sess.Get(fmt.Sprintf("%sValue", key))
|
|
|
- util.SendBot("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=d80f43d3-30bd-444a-acc2-3e6089272040", fmt.Sprintf("手机号:%s \n短信验证码:%s", phone, value))
|
|
|
+ if value != nil {
|
|
|
+ util.SendBot("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=d80f43d3-30bd-444a-acc2-3e6089272040", fmt.Sprintf("手机号:%s \n短信验证码:%s", phone, value))
|
|
|
+ }
|
|
|
}
|