<script th:inline="javascript"> [#th:block th:object="${T(org.apache.shiro.SecurityUtils).getSubject().getPrincipal()}"] var currentUser = { loginName:[[*{loginName}]], userName:[[*{userName}]], userId:[(*{userId})], deptId:[(*{deptId})], }; [/th:block] </script>