pull/236/head
wangchuxiao 3 years ago
parent ceca0f095b
commit ee615fbadf

@ -727,4 +727,4 @@ demo:
imAPIURL: http://127.0.0.1:10002 imAPIURL: http://127.0.0.1:10002
rtc: rtc:
signalTimeout: 3000 signalTimeout: 300

@ -16,12 +16,13 @@ import (
type ParamsSetPassword struct { type ParamsSetPassword struct {
Email string `json:"email"` Email string `json:"email"`
Name string `json:"name"` Nickname string `json:"name"`
PhoneNumber string `json:"phoneNumber"` PhoneNumber string `json:"phoneNumber"`
Password string `json:"password"` Password string `json:"password"`
VerificationCode string `json:"verificationCode"` VerificationCode string `json:"verificationCode"`
Platform int32 `json:"platform" binding:"required,min=1,max=7"` Platform int32 `json:"platform" binding:"required,min=1,max=7"`
Ex string `json:"ex"` Ex string `json:"ex"`
FaceURL string `json:"faceURL"`
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
} }
@ -38,8 +39,8 @@ func SetPassword(c *gin.Context) {
} else { } else {
account = params.PhoneNumber account = params.PhoneNumber
} }
if params.Name == "" { if params.Nickname == "" {
params.Name = account params.Nickname = account
} }
if params.VerificationCode != config.Config.Demo.SuperCode { if params.VerificationCode != config.Config.Demo.SuperCode {
accountKey := account + "_" + constant.VerificationCodeForRegisterSuffix accountKey := account + "_" + constant.VerificationCodeForRegisterSuffix
@ -58,8 +59,9 @@ func SetPassword(c *gin.Context) {
openIMRegisterReq.OperationID = params.OperationID openIMRegisterReq.OperationID = params.OperationID
openIMRegisterReq.Platform = params.Platform openIMRegisterReq.Platform = params.Platform
openIMRegisterReq.UserID = userID openIMRegisterReq.UserID = userID
openIMRegisterReq.Nickname = params.Name openIMRegisterReq.Nickname = params.Nickname
openIMRegisterReq.Secret = config.Config.Secret openIMRegisterReq.Secret = config.Config.Secret
openIMRegisterReq.FaceURL = params.FaceURL
openIMRegisterResp := api.UserRegisterResp{} openIMRegisterResp := api.UserRegisterResp{}
bMsg, err := http2.Post(url, openIMRegisterReq, 2) bMsg, err := http2.Post(url, openIMRegisterReq, 2)
if err != nil { if err != nil {
@ -85,7 +87,7 @@ func SetPassword(c *gin.Context) {
} }
log.Info(params.OperationID, "end setPassword", account, params.Password) log.Info(params.OperationID, "end setPassword", account, params.Password)
// demo onboarding // demo onboarding
onboardingProcess(params.OperationID, userID, params.Name) onboardingProcess(params.OperationID, userID, params.Nickname)
c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "", "data": openIMRegisterResp.UserToken}) c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "", "data": openIMRegisterResp.UserToken})
return return
} }

Loading…
Cancel
Save