A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

(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 内置过滤器表
别名
Filter
CHANNEL_FILTER
ChannelProcessingFilter
SECURITY_CONTEXT_FILTER
SecurityContextPersistenceFilter
CONCURRENT_SESSION_FILTER
ConcurrentSessionFilter
LOGOUT_FILTER
LogoutFilter
X509_FILTER
X509AuthenticationFilter
PRE_AUTH_FILTER
AstractPreAuthenticatedProcessingFilter 的子类
CAS_FILTER
CasAuthenticationFilter
FORM_LOGIN_FILTER
UsernamePasswordAuthenticationFilter
BASIC_AUTH_FILTER
BasicAuthenticationFilter
SERVLET_API_SUPPORT_FILTER
SecurityContextHolderAwareRequestFilter
JAAS_API_SUPPORT_FILTER
JaasApiIntegrationFilter
REMEMBER_ME_FILTER
RememberMeAuthenticationFilter
ANONYMOUS_FILTER
AnonymousAuthenticationFilter
SESSION_MANAGEMENT_FILTER
SessionManagementFilter
EXCEPTION_TRANSLATION_FILTER
ExceptionTranslationFilter
FILTER_SECURITY_INTERCEPTOR
FilterSecurityInterceptor
SWITCH_USER_FILTER
SwitchUserFilter

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马