diff --git a/pkg/router/router.go b/pkg/router/router.go index 2ec3c7d9..9fb1c2ff 100644 --- a/pkg/router/router.go +++ b/pkg/router/router.go @@ -68,14 +68,15 @@ func NewRouter() *gin.Engine { } //账号模块 { - privateGroup.POST("user/register", account.UserRegister) //h5注册登录 - privateGroup.POST("user/login", account.UserLogin) //后台登录 - privateGroup.POST("user/send", account.SendMsg) //发送验证码 - privateGroup.POST("user/logout", account.UserLogout) //登出 - privateGroup.POST("user/check/msg", account.CheckMsg) //校验验证码 - privateGroup.POST("generate/captcha", account.GenerateCaptcha) //生成滑块验证码 - privateGroup.POST("validate/captcha", account.ValidateCaptcha) //验证滑块验证码 - privateGroup.POST("check/register", account.CheckRegister) //校验是否注册 + privateGroup.POST("user/register", account.UserRegister) //h5注册登录 + privateGroup.POST("user/login", account.UserLogin) //后台登录 + privateGroup.POST("user/send", account.SendMsg) //发送验证码 + privateGroup.POST("user/send/no-slider", account.SendMsgNoSlider) //发送验证码(不验证滑块) + privateGroup.POST("user/logout", account.UserLogout) //登出 + privateGroup.POST("user/check/msg", account.CheckMsg) //校验验证码 + privateGroup.POST("generate/captcha", account.GenerateCaptcha) //生成滑块验证码 + privateGroup.POST("validate/captcha", account.ValidateCaptcha) //验证滑块验证码 + privateGroup.POST("check/register", account.CheckRegister) //校验是否注册 acRoute := privateGroup.Group("/user") acRoute.Use(middleware.CheckLogin(service.AccountFieeProvider)) { diff --git a/pkg/service/account/account.go b/pkg/service/account/account.go index 067d8b69..7ec3dd3e 100644 --- a/pkg/service/account/account.go +++ b/pkg/service/account/account.go @@ -413,6 +413,54 @@ func SendMsg(c *gin.Context) { //} } + +// 用户发送验证码(不验证滑块) +func SendMsgNoSlider(c *gin.Context) { + var req account.SendMsgRequest + if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil { + service.Error(c, err) + return + } + + req.Project = "fiee" + req.TelNum = req.Zone + req.TelNum + //todo 审核使用账号 + if req.TelNum == "8618888888888" { + service.Success1(c, "发送成功", &account.SendMsgStatusResponse{}) + return + } + if req.Zone != e.ZoneCn && req.Zone != "" { + // ============================== redis检查ip开始 + ip := c.ClientIP() + fmt.Println("当前ip:", ip, ";手机号:", req.TelNum, ";domain:", req.Domain) + + tempReq := &account.SendNationMsgRequest{ + Domain: req.Domain, + TelNum: req.TelNum, + Project: req.Project, + SignNo: req.SignNo, + MId: req.MId, + Scope: req.Scope, + } + res, err := service.AccountFieeProvider.SendNationMsg(context.Background(), tempReq) + if err != nil { + service.Error(c, err) + return + } + service.Success1(c, "发送成功", res) + return + } else { + res, err := service.AccountFieeProvider.SendMsg(context.Background(), &req) + if err != nil { + service.Error(c, err) + return + } + + service.Success1(c, "发送成功", res) + return + } +} + func RealName(c *gin.Context) { var req account.RealNameRequest