(3)创建 indexController.js [AppleScript] 纯文本查看 复制代码 //首页控制器app.controller('indexController',function($scope,loginService){
$scope.showName=function(){ loginService.showName().success(
function(response){
$scope.loginName=response.loginName;
}
);
}
}); (5)修改 home-index.html 引入 js [AppleScript] 纯文本查看 复制代码 <script type="text/javascript" src="plugins/angularjs/angular.min.js"></script>
<script type="text/javascript" src="js/base.js"></script>
<script type="text/javascript" src="js/service/loginService.js"></script>
<script type="text/javascript" src="js/controller/indexController.js"></script> 指令,调用方法查询登陆名 [AppleScript] 纯文本查看 复制代码 <body ng-app="pinyougou" ng-controller="indexController" ng-init="showName()"> 显示用户名 [AppleScript] 纯文本查看 复制代码 <span class="name">{{loginName}}</span> 5.1.1 退出登录 设置退出登录后的跳转地址 [AppleScript] 纯文本查看 复制代码 <beans:bean id="requestSingleLogoutFilter" class="org.springframework.security.web.authentication.logout.LogoutFilter">
<beans:constructor-arg value="http://localhost:9100/cas/logout?service=http://localhost:9103"/>
........
</beans:bean> 退出登录后,跳转到网站首页 [AppleScript] 纯文本查看 复制代码 <span class="safe"> <a href="/logout/cas">退出登录 </a></span> 附录 A. Spring Security 内置过滤器表 别名 | | | | | SecurityContextPersistenceFilter | CONCURRENT_SESSION_FILTER | | | | | | | AstractPreAuthenticatedProcessingFilter 的子类 | | | | UsernamePasswordAuthenticationFilter | | BasicAuthenticationFilter | SERVLET_API_SUPPORT_FILTER | SecurityContextHolderAwareRequestFilter | | | | RememberMeAuthenticationFilter | | AnonymousAuthenticationFilter | SESSION_MANAGEMENT_FILTER | | EXCEPTION_TRANSLATION_FILTER | ExceptionTranslationFilter | FILTER_SECURITY_INTERCEPTOR | FilterSecurityInterceptor | | |
|