From a2de50aea7b9bf5377aa09ebbaab45b41f2575c8 Mon Sep 17 00:00:00 2001 From: yoneyan Date: Sat, 20 Feb 2021 21:25:06 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20#34=20#42=20Issue=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/api/core/user/v0/user.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/api/core/user/v0/user.go b/pkg/api/core/user/v0/user.go index 5f8df7c8..5d6ffaf4 100644 --- a/pkg/api/core/user/v0/user.go +++ b/pkg/api/core/user/v0/user.go @@ -116,12 +116,12 @@ func MailVerify(c *gin.Context) { result := dbUser.Get(user.MailToken, &user.User{MailToken: mailToken}) if result.Err != nil { - c.JSON(http.StatusInternalServerError, common.Error{Error: result.Err.Error() + "| we can't find token data"}) + c.JSON(http.StatusBadRequest, common.Error{Error: result.Err.Error() + "| we can't find token data"}) return } if *result.User[0].MailVerify { - c.JSON(http.StatusInternalServerError, common.Error{Error: fmt.Sprintf("This email has already been checked")}) + c.JSON(http.StatusBadRequest, common.Error{Error: fmt.Sprintf("This email has already been checked")}) return } if result.User[0].Status >= 100 { @@ -133,7 +133,7 @@ func MailVerify(c *gin.Context) { MailVerify: &[]bool{true}[0]}); err != nil { c.JSON(http.StatusInternalServerError, common.Error{Error: err.Error()}) } else { - c.JSON(http.StatusOK, &user.Result{}) + c.JSON(http.StatusOK, &common.Result{Result: "OK"}) } }