...
|
...
|
@@ -28,7 +28,7 @@ func RequestUCenterLogin(account, password string) (*ResponseLogin, error) { |
|
|
}
|
|
|
if !(uclientReturn.Code == ResponseCode0 &&
|
|
|
uclientReturn.Msg == ResponseMsgOk) {
|
|
|
return nil, protocol.NewErrWithMessage("10021")
|
|
|
return nil, protocol.NewErrWithMessage("10052")
|
|
|
}
|
|
|
return uclientReturn, nil
|
|
|
}
|
...
|
...
|
@@ -60,7 +60,7 @@ func RequestUCenterAddUser(phone string, nickname string, avatar string) (*Respo |
|
|
}
|
|
|
if !(ucenterReturn.Code == ResponseCode0 &&
|
|
|
ucenterReturn.Msg == ResponseMsgOk) {
|
|
|
return nil, protocol.NewErrWithMessage("10040")
|
|
|
return nil, protocol.NewErrWithMessage("10052")
|
|
|
}
|
|
|
return ucenterReturn, nil
|
|
|
}
|
...
|
...
|
@@ -87,7 +87,7 @@ func RequestUCenterSmsCode(phone string) error { |
|
|
}
|
|
|
if !(ucenterReturn.Code == ResponseCode0 &&
|
|
|
ucenterReturn.Msg == ResponseMsgOk) {
|
|
|
return protocol.NewErrWithMessage("10040")
|
|
|
return protocol.NewErrWithMessage("10052")
|
|
|
}
|
|
|
return nil
|
|
|
}
|
...
|
...
|
@@ -113,7 +113,58 @@ func RequestUCenterLoginSms(phone string, captcha string) (*ResponseLoginSms, er |
|
|
}
|
|
|
if !(ucenterReturn.Code == ResponseCode0 &&
|
|
|
ucenterReturn.Msg == ResponseMsgOk) {
|
|
|
return nil, protocol.NewErrWithMessage("10040")
|
|
|
return nil, protocol.NewErrWithMessage("10052")
|
|
|
}
|
|
|
return ucenterReturn, nil
|
|
|
}
|
|
|
|
|
|
func RequestUCenterSmsCodeCheck(phone string, captcha string) (*ResponseSmsCodeCheck, error) {
|
|
|
param := RequestSmsCodeCheck{
|
|
|
Phone: phone,
|
|
|
Captcha: captcha,
|
|
|
}
|
|
|
uclient := NewUCenterClient()
|
|
|
btBody, err := uclient.Call(param)
|
|
|
if err != nil {
|
|
|
log.Error("统一用户中心请求失败 err:%s", err)
|
|
|
return nil, protocol.NewErrWithMessage("1")
|
|
|
}
|
|
|
var ucenterReturn *ResponseSmsCodeCheck
|
|
|
err = json.Unmarshal(btBody, ucenterReturn)
|
|
|
if err != nil {
|
|
|
log.Error("解析统一用户中心响应失败 err:%s", err)
|
|
|
return nil, protocol.NewErrWithMessage("1")
|
|
|
}
|
|
|
if !(ucenterReturn.Code == ResponseCode0 &&
|
|
|
ucenterReturn.Msg == ResponseMsgOk) {
|
|
|
return nil, protocol.NewErrWithMessage("10026")
|
|
|
}
|
|
|
return ucenterReturn, nil
|
|
|
}
|
|
|
|
|
|
func RequestUCenterRestPassword(phone, newPwd, confirmPwd, certificate string) error {
|
|
|
param := RequestResetPassword{
|
|
|
Phone: phone,
|
|
|
CaptchaCertificate: certificate,
|
|
|
NewPwd: newPwd,
|
|
|
ConfirmPwd: confirmPwd,
|
|
|
}
|
|
|
uclient := NewUCenterClient()
|
|
|
btBody, err := uclient.Call(param)
|
|
|
if err != nil {
|
|
|
log.Error("统一用户中心请求失败 err:%s", err)
|
|
|
return protocol.NewErrWithMessage("1")
|
|
|
}
|
|
|
var ucenterReturn *CommResponse
|
|
|
err = json.Unmarshal(btBody, ucenterReturn)
|
|
|
if err != nil {
|
|
|
log.Error("解析统一用户中心响应失败 err:%s", err)
|
|
|
return protocol.NewErrWithMessage("1")
|
|
|
}
|
|
|
if !(ucenterReturn.Code == ResponseCode0 &&
|
|
|
ucenterReturn.Msg == ResponseMsgOk) {
|
|
|
return protocol.NewErrWithMessage("10052")
|
|
|
}
|
|
|
|
|
|
return nil
|
|
|
} |
...
|
...
|
|