mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 04:10:20 +08:00
Improve API error handling.
This commit is contained in:
@ -32,3 +32,11 @@ func (c *ApiController) GetSessionUser() string {
|
||||
func (c *ApiController) SetSessionUser(user string) {
|
||||
c.SetSession("username", user)
|
||||
}
|
||||
|
||||
func wrapActionResponse(affected bool) *Response {
|
||||
if affected {
|
||||
return &Response{Status: "ok", Msg: "", Data: "affected"}
|
||||
} else {
|
||||
return &Response{Status: "ok", Msg: "", Data: "unaffected"}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user