11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<beans : beans xmlns =" http://www.springframework.org/schema/security"
3- xmlns:beans=" http://www.springframework.org/schema/beans" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xmlns:beans=" http://www.springframework.org/schema/beans"
4+ xmlns:dubbo=" http://code.alibabatech.com/schema/dubbo" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
45 xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
6+ http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd
57 http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd" >
68
79
1618 <!-- 页面的拦截规则 use-expressions:是否启动SPEL表达式 默认是true -->
1719 <http use-expressions =" false" >
1820 <!-- 当前用户必须拥有ROLE_USER的角色 才可以访问更目录及所属子目录的资源 -->
19- <intercept-url pattern =" /*" access =" ROLE_SELLER" />
21+ <intercept-url pattern =" /** " access =" ROLE_SELLER" />
2022 <!-- 开启表单登录功能 -->
21- <form-login login-page =" /shoplogin.html" default-target-url =" /admin/index.html" authentication-failure-forward- url =" /shoplogin.html" always-use-default-target =" true" />
23+ <form-login login-page =" /shoplogin.html" default-target-url =" /admin/index.html" authentication-failure-url =" /shoplogin.html" always-use-default-target =" true" />
2224 <csrf disabled =" true" />
2325 <headers >
2426 <frame-options policy =" SAMEORIGIN" />
2931 <authentication-manager >
3032 <!-- 认证的提供者 -->
3133 <authentication-provider user-service-ref =" userDetailService" >
32-
34+ < password-encoder ref = " bcryptEncoder " ></ password-encoder >
3335 </authentication-provider >
3436 </authentication-manager >
3537
3638 <!-- 认证类 -->
3739 <beans : bean id =" userDetailService" class =" com.pinyougou.service.UserDetailsServiceImpl" >
40+ <beans : property name =" sellerService" ref =" sellerService" ></beans : property >
3841 </beans : bean >
3942
43+ <!-- 引用dubbo 服务 -->
44+ <dubbo : application name =" pinyougou-shop-web" />
45+ <dubbo : registry address =" zookeeper://192.168.25.135:2181" timeout =" 50000" />
46+ <dubbo : reference id =" sellerService" interface =" com.pinyougou.sellergoods.service.SellerService" ></dubbo : reference >
47+
48+
49+ <beans : bean id =" bcryptEncoder" class =" org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder" ></beans : bean >
4050</beans : beans >
0 commit comments