wiki图片权限判断

This commit is contained in:
暮光:城中城
2019-04-21 23:37:56 +08:00
parent aaa267a6c4
commit d406b52d6a
3 changed files with 25 additions and 3 deletions

View File

@@ -14,10 +14,12 @@ public class DocUserUtil {
*/
public static DocUserDetails getCurrentUser() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
Object principal = null;
if (authentication != null) {
principal = authentication.getPrincipal();
Object principal = authentication.getPrincipal();
if (principal instanceof DocUserDetails) {
return (DocUserDetails) principal;
}
}
return (DocUserDetails) principal;
return null;
}
}