فهرست منبع

增加查看当前登录用户的权限

zhouhao 8 سال پیش
والد
کامیت
4071b1201a

+ 7 - 2
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-controller/src/main/java/org/hswebframework/web/controller/authorization/AuthorizationController.java

@@ -55,7 +55,6 @@ public class AuthorizationController {
     private AuthorizationListenerDispatcher authorizationListenerDispatcher;
 
     @GetMapping("/login-out")
-    @AccessLogger("退出登录")
     @Authorize
     @ApiOperation("退出当前登录")
     public ResponseMessage exit(@ApiParam(hidden = true) Authentication authentication) {
@@ -63,8 +62,14 @@ public class AuthorizationController {
         return ok();
     }
 
+    @GetMapping("/me")
+    @Authorize
+    @ApiOperation("当前登录用户权限信息")
+    public ResponseMessage<Authentication> me(@ApiParam(hidden = true) Authentication authentication) {
+        return ok(authentication);
+    }
+
     @PostMapping(value = "/login")
-    @AccessLogger("授权")
     @ApiOperation("用户名密码登录")
     public ResponseMessage<String> authorize(@RequestParam @ApiParam("用户名") String username,
                                              @RequestParam @ApiParam("密码") String password,