mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 10:45:47 +08:00
feat: improve code in getObject()
This commit is contained in:
parent
3e8bfb52a8
commit
75699c4a26
@ -73,10 +73,12 @@ func getObject(ctx *context.Context) (string, string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// query == "?id=built-in/admin"
|
if !(strings.HasPrefix(ctx.Request.URL.Path, "/api/get-") && strings.HasSuffix(ctx.Request.URL.Path, "s")) {
|
||||||
id := ctx.Input.Query("id")
|
// query == "?id=built-in/admin"
|
||||||
if id != "" {
|
id := ctx.Input.Query("id")
|
||||||
return util.GetOwnerAndNameFromIdNoCheck(id)
|
if id != "" {
|
||||||
|
return util.GetOwnerAndNameFromIdNoCheck(id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
owner := ctx.Input.Query("owner")
|
owner := ctx.Input.Query("owner")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user