Commit 664b5c6eefb61148a2c5b0eeda194313768cfdb3

Authored by fangcheng
1 parent ccba6df33f
Exists in master

修改shiro

Showing 3 changed files with 19 additions and 22 deletions

parent/center.manager/src/main/resources/app-context.xml View file @ 664b5c6
1 1 <beans xmlns="http://www.springframework.org/schema/beans"
2 2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
3   - xmlns:aop="http://www.springframework.org/schema/aop"
4   - xmlns:context="http://www.springframework.org/schema/context"
  3 + xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
5 4 xmlns:mvc="http://www.springframework.org/schema/mvc"
6 5 xsi:schemaLocation="
7 6 http://www.springframework.org/schema/beans
8 7  
9 8  
... ... @@ -12,18 +11,21 @@
12 11 http://www.springframework.org/schema/aop/spring-aop.xsd
13 12 http://www.springframework.org/schema/mvc
14 13 http://www.springframework.org/schema/mvc/spring-mvc.xsd">
15   -
  14 + <bean id="placeholder" class="com.lyms.spring.PropertiesUtil">
  15 + <property name="locations">
  16 + <list>
  17 + <value>classpath:jdbc.properties</value>
  18 + <value>classpath:redis.properties</value>
  19 + </list>
  20 + </property>
  21 + </bean>
16 22 <context:annotation-config />
17   - <!-- 扫描控制器 禁用use-default-filters 不重复扫描@Service,@Repository等..否则将导致事务失效 -->
18 23 <context:component-scan base-package="com.lyms"></context:component-scan>
19   - <!-- context 容器获取扫描 -->
20   - <!-- <context:component-scan base-package="com.lyms.spring" /> -->
21   - <context:property-placeholder location="classpath:dev/jdbc.properties,classpath:dev/redis.properties"/>
22   -
23   - <bean class="com.lyms.web.listener.StartupListener"/>
24   -
25   - <bean class="com.lyms.context.AppContext"/>
26   -
27   - <import resource="xml/app-*.xml" />
  24 +
  25 + <bean class="com.lyms.web.listener.StartupListener" />
  26 +
  27 + <bean class="com.lyms.context.AppContext" />
  28 +
  29 + <import resource="xml/app-*.xml" />
28 30 </beans>
parent/center.manager/src/main/resources/xml/app-shiro.xml View file @ 664b5c6
... ... @@ -45,13 +45,12 @@
45 45 </property>
46 46 <property name="filterChainDefinitions">
47 47 <value>
48   - <!-- /login = anon
  48 + /login = anon
49 49 /remote/** =anon
50 50 /logout = logout
51 51 /static/** = anon
52 52 /authenticated = authc
53   - /** = user,forceLogout -->
54   - /** = anon
  53 + /** = user,forceLogout
55 54 </value>
56 55 </property>
57 56 </bean>
parent/core.sdk/src/main/java/com/lyms/shiro/ShiroWebUtils.java View file @ 664b5c6
... ... @@ -138,12 +138,8 @@
138 138 * <li>修改时间:
139 139 */
140 140 public static final boolean isLogin(){
141   - Subject currentUser = SecurityUtils.getSubject();
142   - if (null != currentUser) {
143   - Session session = currentUser.getSession();
144   - if (null != session) {
145   - return true;
146   - }
  141 + if (null != getCurrentUser()) {
  142 + return true;
147 143 }
148 144 return false;
149 145 }