基础整理

This commit is contained in:
hoteas
2022-05-02 15:42:54 +08:00
parent bdcec2d534
commit 062e849d44
10 changed files with 425 additions and 13 deletions
+26
View File
@@ -0,0 +1,26 @@
package salesman
import (
. "code.hoteas.com/golang/hotime"
"code.hoteas.com/golang/hotime/dri/ddsms"
)
var Sms = Ctr{
//只允许微信验证过的或者登录成功的发送短信
"send": func(that *Context) {
phone := that.Req.FormValue("phone")
if len(phone) < 11 {
that.Display(3, "手机号格式错误")
return
}
code := getCode()
that.Session("phone", phone)
that.Session("code", code)
ddsms.DDY.SendYZM(phone, that.Config.GetString("smsLogin"), map[string]string{"code": code})
that.Display(0, "发送成功")
},
}