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