|
|
@ -23,8 +23,9 @@ func UserRegister(c *gin.Context) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if params.Secret != config.Config.Secret {
|
|
|
|
if params.Secret != config.Config.Secret {
|
|
|
|
log.NewError(params.OperationID, "params.Secret != config.Config.Secret", params.Secret, config.Config.Secret)
|
|
|
|
errMsg := " params.Secret != config.Config.Secret "
|
|
|
|
c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "not authorized"})
|
|
|
|
log.NewError(params.OperationID, errMsg, params.Secret, config.Config.Secret)
|
|
|
|
|
|
|
|
c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": errMsg})
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
req := &rpc.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}}
|
|
|
|
req := &rpc.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}}
|
|
|
@ -36,7 +37,7 @@ func UserRegister(c *gin.Context) {
|
|
|
|
client := rpc.NewAuthClient(etcdConn)
|
|
|
|
client := rpc.NewAuthClient(etcdConn)
|
|
|
|
reply, err := client.UserRegister(context.Background(), req)
|
|
|
|
reply, err := client.UserRegister(context.Background(), req)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
log.NewError(req.OperationID, "call rpc err ", err)
|
|
|
|
log.NewError(req.OperationID, "call rpc err ", err.Error())
|
|
|
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "internal service err"})
|
|
|
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "internal service err"})
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|