|
|
|
@ -30,7 +30,7 @@ func InitManageApi() {
|
|
|
|
towgo.SetFunc(_methodHead+"/user/regByMobile", userRegByMobile)
|
|
|
|
towgo.SetFunc(_methodHead+"/user/regByMobile", userRegByMobile)
|
|
|
|
|
|
|
|
|
|
|
|
//获取注册短信验证码
|
|
|
|
//获取注册短信验证码
|
|
|
|
towgo.SetFunc(_methodHead+"/user/getRegSMSVerificationCode", getRegSMSVerificationCode)
|
|
|
|
towgo.SetFunc(_methodHead+"/user/getLoginOrRegSMSVerificationCode", getLoginOrRegSMSVerificationCode)
|
|
|
|
|
|
|
|
|
|
|
|
//修改密码 F
|
|
|
|
//修改密码 F
|
|
|
|
towgo.SetFunc(_methodHead+"/user/changepassword", userChangepassword)
|
|
|
|
towgo.SetFunc(_methodHead+"/user/changepassword", userChangepassword)
|
|
|
|
@ -45,7 +45,7 @@ func isPhoneNumber(input string) bool {
|
|
|
|
return reg.MatchString(input)
|
|
|
|
return reg.MatchString(input)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func getRegSMSVerificationCode(rpcConn towgo.JsonRpcConnection) {
|
|
|
|
func getLoginOrRegSMSVerificationCode(rpcConn towgo.JsonRpcConnection) {
|
|
|
|
var params struct {
|
|
|
|
var params struct {
|
|
|
|
Mobile string `json:"mobile"`
|
|
|
|
Mobile string `json:"mobile"`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -56,7 +56,7 @@ func getRegSMSVerificationCode(rpcConn towgo.JsonRpcConnection) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
code, err := StoreRegSMSVerificationCode(params.Mobile)
|
|
|
|
code, err := StoreLoginOrloginOrRegSMSVerificationCode(params.Mobile)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
rpcConn.WriteError(500, err.Error())
|
|
|
|
rpcConn.WriteError(500, err.Error())
|
|
|
|
return
|
|
|
|
return
|
|
|
|
@ -92,7 +92,7 @@ func userRegByMobile(rpcConn towgo.JsonRpcConnection) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if !RegSMSVerification(params.Mobile, params.VerificationCode) {
|
|
|
|
if !LoginOrRegSMSVerification(params.Mobile, params.VerificationCode) {
|
|
|
|
rpcConn.WriteError(500, "验证码错误")
|
|
|
|
rpcConn.WriteError(500, "验证码错误")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -186,7 +186,7 @@ func userLoginOrRegByMobile(rpcConn towgo.JsonRpcConnection) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if !RegSMSVerification(params.Mobile, params.VerificationCode) {
|
|
|
|
if !LoginOrRegSMSVerification(params.Mobile, params.VerificationCode) {
|
|
|
|
rpcConn.WriteError(500, "验证码错误")
|
|
|
|
rpcConn.WriteError(500, "验证码错误")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|