黑马程序员技术交流社区

标题: 【郑州校区】Java之品优购课程讲义_day15(7) [打印本页]

作者: 谷粒姐姐    时间: 2018-10-23 10:29
标题: 【郑州校区】Java之品优购课程讲义_day15(7)
(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






欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2