0

当尝试像这样实现 SecuredAction 时:

def index = SecuredAction {
    Ok(views.html.index())
}

我得到一个

Overloaded method value [SecuredAction] cannot be applied to (play.api.mvc.SimpleResult[play.api.templates.Html])
4

1 回答 1

0

忘了implicit request =>

所以:

def index = SecuredAction { implicit request =>
    Ok(views.html.index())
}

是正确的。

于 2013-06-25T09:13:35.930 回答