feat: 管理后台登录
This commit is contained in:
@@ -18,6 +18,7 @@ func NewUserHandler(svc *service.UserService) *UserHandler {
|
||||
func (h *UserHandler) Register(w http.ResponseWriter, r *http.Request) {
|
||||
var body struct {
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
Identity string `json:"identity"`
|
||||
}
|
||||
|
||||
@@ -26,7 +27,7 @@ func (h *UserHandler) Register(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
user, err := h.svc.Register(body.Email, body.Identity)
|
||||
user, err := h.svc.Register(body.Email, body.Password, body.Identity)
|
||||
if err != nil {
|
||||
SendError(w, http.StatusInternalServerError, 5001, "Failed to register user")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user