mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 03:00:18 +08:00
Handle json error in Login().
This commit is contained in:
@ -94,7 +94,10 @@ func (c *ApiController) Login() {
|
||||
var form RequestForm
|
||||
err := json.Unmarshal(c.Ctx.Input.RequestBody, &form)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
resp = &Response{Status: "error", Msg: err.Error()}
|
||||
c.Data["json"] = resp
|
||||
c.ServeJSON()
|
||||
return
|
||||
}
|
||||
|
||||
if form.Username != "" {
|
||||
|
Reference in New Issue
Block a user