diff --git a/cmd/srv/controller/user_api.go b/cmd/srv/controller/user_api.go index 60d2749..504094c 100644 --- a/cmd/srv/controller/user_api.go +++ b/cmd/srv/controller/user_api.go @@ -19,8 +19,8 @@ type userAPI struct { func (ua *userAPI) serve() { ur := ua.r.Group("") - ur.POST("/login", ua.login) - ur.POST("/register", ua.register) + ur.POST("/user/login", ua.login) + ur.POST("/user/register", ua.register) v1 := ua.r.Group("v1") { diff --git a/model/user.go b/model/user.go index 0554086..a76b4c5 100644 --- a/model/user.go +++ b/model/user.go @@ -13,7 +13,7 @@ import ( type User struct { Common UserName string `json:"username,omitempty" gorm:"unique;column:username"` - Password string `json:"password,omitempty" gorm:"column:password"` + Password string `json:"-" gorm:"column:password"` ForgotPasswordCode string `json:"forgot_password_code,omitempty" gorm:"column:forgot_password_code"` VerificationCode string `json:"verification_code,omitempty" gorm:"column:verification_code"` diff --git a/resource/template/login.html b/resource/template/login.html index b347dbf..66cc430 100644 --- a/resource/template/login.html +++ b/resource/template/login.html @@ -1,6 +1,6 @@ {{ define "login" }} {{template "base/header" .}} -
+

Go-Gin Login

diff --git a/resource/template/register.html b/resource/template/register.html index 3b05490..f40de1c 100644 --- a/resource/template/register.html +++ b/resource/template/register.html @@ -1,6 +1,6 @@ {{ define "register" }} {{template "base/header" .}} - +

Go-Gin Register