mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 03:00:18 +08:00
Refactor GetDefaultApplication().
This commit is contained in:
@ -50,9 +50,18 @@ func (c *ApiController) GetApplication() {
|
||||
// @Success 200 {object} object.Application The Response object
|
||||
// @router /get-default-application [get]
|
||||
func (c *ApiController) GetDefaultApplication() {
|
||||
owner := c.Input().Get("owner")
|
||||
//owner := c.Input().Get("owner")
|
||||
|
||||
c.Data["json"] = object.GetDefaultApplication(owner)
|
||||
if c.GetSessionUser() == "" {
|
||||
c.Data["json"] = nil
|
||||
c.ServeJSON()
|
||||
return
|
||||
}
|
||||
|
||||
username := c.GetSessionUser()
|
||||
user := object.GetUser(username)
|
||||
|
||||
c.Data["json"] = object.GetApplicationByUser(user)
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user