Commit 4f1d5345 authored by haoyanbin's avatar haoyanbin

1

parent 6da653b4
......@@ -38,6 +38,7 @@ func CreateSurveyUser(c *gin.Context) {
service.CreateSurveyUserData(v)
}
response.OkWithMessage("创建成功", c)
return
}
......
......@@ -16,6 +16,27 @@ import (
"time"
)
func SendCode(c *gin.Context) {
var r request.SendCodeReq
_ = c.ShouldBindJSON(&r)
response.OkWithMessage("发送成功", c)
return
}
func CheckCode(c *gin.Context) {
var r request.CheckCodeReq
_ = c.ShouldBindJSON(&r)
if r.Code == "111111" {
response.OkWithMessage("验证成功", c)
return
}
response.FailWithMessage("验证失败", c)
return
}
// @Tags mobile
// @Summary 用户登录
// @Produce application/json
......@@ -118,7 +139,6 @@ func Login(c *gin.Context) {
}
}
j := &middleware.JWT{SigningKey: []byte(global.GVA_CONFIG.JWT.SigningKey)} // 唯一签名
claims := request.CustomClaims{
UUID: userData.UUID,
......@@ -382,7 +402,6 @@ func UserAutheInfo(c *gin.Context) {
reply.ImExpert = imExpertReply.Data
}
response.OkWithData(gin.H{"reply": reply}, c)
return
}
......@@ -414,7 +433,6 @@ func CreateUserAuthe(c *gin.Context) {
return
}
response.OkWithMessage("创建成功", c)
return
}
......
......@@ -5,6 +5,15 @@ import (
uuid "github.com/satori/go.uuid"
)
type SendCodeReq struct {
Mobile string `json:"mobile"`
}
type CheckCodeReq struct {
Mobile string `json:"mobile"`
Code string `json:"code"`
}
type MobileRegisterReq struct {
Mobile string `json:"mobile"` //Phone:手机登录 WeChat:微信登录
HospitalCode string `json:"hospitalCode"` //Phone:手机登录 WeChat:微信登录
......
......@@ -14,6 +14,8 @@ func InitMobileUserLoginRouter(Router *gin.RouterGroup) {
UserRouter.POST("register", mobile.Register) // 用户注册账号
UserRouter.POST("getOpenid", mobile.GetOpenid) // 用户注册账号
UserRouter.POST("getUserName", mobile.GetUserName) // 用户注册账号
UserRouter.POST("sendCode", mobile.SendCode) // 用户注册账号
UserRouter.POST("checkCode", mobile.CheckCode) // 用户注册账号
}
}
func InitMobileUserPublicRouter(Router *gin.RouterGroup) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment