From 188a90f97d0f670bf5d91fb5b54418239a2dbfcc Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 28 Dec 2021 18:01:40 +0800 Subject: [PATCH] tidy code --- internal/api/auth/auth.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/api/auth/auth.go b/internal/api/auth/auth.go index 4b218f263..315849aa2 100644 --- a/internal/api/auth/auth.go +++ b/internal/api/auth/auth.go @@ -36,8 +36,9 @@ func UserRegister(c *gin.Context) { client := rpc.NewAuthClient(etcdConn) reply, err := client.UserRegister(context.Background(), req) if err != nil || reply.CommonResp.ErrCode != 0 { - log.NewError(req.OperationID, "UserRegister failed ", err, reply.CommonResp.ErrCode) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": reply.CommonResp.ErrMsg}) + log.NewError(req.OperationID, "UserRegister failed ", err, reply.CommonResp.ErrCode) return }