mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 04:10:20 +08:00
Use c.ResponseError() for all places.
This commit is contained in:
@ -55,15 +55,13 @@ func (c *ApiController) GetLdapUser() {
|
||||
|
||||
conn, err := object.GetLdapConn(ldapServer.Host, ldapServer.Port, ldapServer.Admin, ldapServer.Passwd)
|
||||
if err != nil {
|
||||
c.Data["json"] = Response{Status: "error", Msg: err.Error()}
|
||||
c.ServeJSON()
|
||||
c.ResponseError(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
//groupsMap, err := conn.GetLdapGroups(ldapServer.BaseDn)
|
||||
//if err != nil {
|
||||
// c.Data["json"] = Response{Status: "error", Msg: err.Error()}
|
||||
// c.ServeJSON()
|
||||
// c.ResponseError(err.Error())
|
||||
// return
|
||||
//}
|
||||
|
||||
@ -76,8 +74,7 @@ func (c *ApiController) GetLdapUser() {
|
||||
|
||||
users, err := conn.GetLdapUsers(ldapServer.BaseDn)
|
||||
if err != nil {
|
||||
c.Data["json"] = Response{Status: "error", Msg: err.Error()}
|
||||
c.ServeJSON()
|
||||
c.ResponseError(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user