更新时间:2023-12-03 19:43:34
您可以使用springSecurityService来获取控制器中的一些用户信息: b
$ b
Well you can use the springSecurityService to get some user information in a controller:
class MyController {
def springSecurityService
def myAction() {
def principal = springSecurityService.principal
String username = principal.username
...
}
}
或在gsp中
<sec:loggedInUserInfo field="username" />
这是一个相当普遍的问题。
It is a pretty general question.