webmvc.xml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
  4. xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.1.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
  6. <!-- 开启@AspectJ AOP代理 -->
  7. <aop:aspectj-autoproxy />
  8. <mvc:annotation-driven>
  9. <mvc:message-converters register-defaults="true">
  10. <!-- 避免IE执行AJAX时,返回JSON出现下载文件 -->
  11. <bean id="fastJsonHttpMessageConverter"
  12. class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
  13. <property name="supportedMediaTypes">
  14. <list>
  15. <value>application/json;charset=UTF-8</value>
  16. </list>
  17. </property>
  18. <property name="features">
  19. <list>
  20. <value>DisableCircularReferenceDetect</value>
  21. </list>
  22. </property>
  23. </bean>
  24. </mvc:message-converters>
  25. <mvc:argument-resolvers>
  26. <!-- 解析分页参数 -->
  27. <bean class="org.springframework.data.web.PageableHandlerMethodArgumentResolver"></bean>
  28. </mvc:argument-resolvers>
  29. </mvc:annotation-driven>
  30. <!--<mvc:annotation-driven />-->
  31. <mvc:default-servlet-handler />
  32. <mvc:resources mapping="/static/**" location="/resources/" />
  33. <mvc:resources mapping="/product/static/**" location="/resources/" />
  34. <mvc:resources mapping="/images/static/**" location="/resources/" />
  35. <mvc:resources mapping="/shop/static/**" location="/resources/" />
  36. <context:component-scan base-package="com.uas.platform" >
  37. <context:exclude-filter type="annotation" expression="org.springframework.scheduling.annotation.EnableScheduling"/>
  38. </context:component-scan>
  39. <bean class="org.springframework.mobile.device.view.LiteDeviceDelegatingViewResolver">
  40. <constructor-arg>
  41. <bean
  42. class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  43. <property name="prefix" value="/WEB-INF/views/" />
  44. <property name="suffix" value=".html" />
  45. <property name="contentType" value="text/html;charset=UTF-8" />
  46. </bean>
  47. </constructor-arg>
  48. <property name="normalPrefix" value="normal/" />
  49. <property name="mobilePrefix" value="mobile/" />
  50. <property name="tabletPrefix" value="tablet/" />
  51. </bean>
  52. <mvc:view-controller path="/" view-name="index" />
  53. <mvc:view-controller path="/index" view-name="index" />
  54. <mvc:view-controller path="/signin" view-name="signin" />
  55. <mvc:view-controller path="/user" view-name="user_center" />
  56. <mvc:view-controller path="/sale" view-name="sale_center" />
  57. <mvc:view-controller path="/product" view-name="product" />
  58. <mvc:view-controller path="/news" view-name="news" />
  59. <mvc:view-controller path="/activity" view-name="activity" />
  60. <mvc:view-controller path="/products" view-name="products" />
  61. <!-- 后台管理页面为适应UAS跳转管理模式,去除左侧导航栏 -->
  62. <mvc:view-controller path="/admin" view-name="adminWithNav" />
  63. <!-- 保留了左侧导航栏的后台管理入口 -->
  64. <!-- 供应商列表页 -->
  65. <mvc:view-controller path="/providers" view-name="provider_list" />
  66. <mvc:view-controller path="/admin_n" view-name="admin" />
  67. <mvc:view-controller path="/image" view-name="image_admin" />
  68. <mvc:view-controller path="/vendor" view-name="vendor_center" />
  69. <mvc:view-controller path="/help" view-name="help" />
  70. <mvc:view-controller path="/commonSearch"
  71. view-name="commonSearch" />
  72. <mvc:view-controller path="/login/proxy" view-name="proxyLogin" />
  73. <mvc:view-controller path="/logout/proxy" view-name="proxyLogout" />
  74. <mvc:view-controller path="/order/proxy" view-name="proxyOrder" />
  75. <!-- erp对接页面 -->
  76. <mvc:view-controller path="/user_erp" view-name="erp/user_center" />
  77. <mvc:view-controller path="/vendor_erp" view-name="erp/vendor_center" />
  78. <mvc:view-controller path="/sso" view-name="sso" />
  79. <mvc:interceptors>
  80. <!-- SSO过滤 -->
  81. <mvc:interceptor>
  82. <mvc:mapping path="/**"/>
  83. <mvc:exclude-mapping path="/WEB-INF/**" />
  84. <mvc:exclude-mapping path="/**/static/**" />
  85. <mvc:exclude-mapping path="/" />
  86. <mvc:exclude-mapping path="/login/**" />
  87. <mvc:exclude-mapping path="/newLogin/**" />
  88. <mvc:exclude-mapping path="/register/**" />
  89. <mvc:exclude-mapping path="/logout/**" />
  90. <mvc:exclude-mapping path="/index" />
  91. <mvc:exclude-mapping path="/index_o" />
  92. <mvc:exclude-mapping path="/product" />
  93. <mvc:exclude-mapping path="/store/**" />
  94. <mvc:exclude-mapping path="/providers/**" />
  95. <mvc:exclude-mapping path="/api/**" />
  96. <mvc:exclude-mapping path="/api/order/trading/volume/**" />
  97. <mvc:exclude-mapping path="/search/**" />
  98. <mvc:exclude-mapping path="/commonSearch/**" />
  99. <mvc:exclude-mapping path="/help" />
  100. <mvc:exclude-mapping path="/base/enterprise/**" />
  101. <mvc:exclude-mapping path="/trade/help/api/**" />
  102. <mvc:exclude-mapping path="/recommendation/**" />
  103. <mvc:exclude-mapping path="/news"/>
  104. <mvc:exclude-mapping path="/activity"/>
  105. <mvc:exclude-mapping path="/seek/qualityBuyer/getBuyerPageInfo"/>
  106. <mvc:exclude-mapping path="/seek/getSeekPageInfo"/>
  107. <mvc:exclude-mapping path="/seek/getSeekRanking"/>
  108. <mvc:exclude-mapping path="/seek/release/template"/>
  109. <mvc:exclude-mapping path="/erp/productReplace/update"/>
  110. <mvc:exclude-mapping path="/basic/enterprise/findByName/**"/>
  111. <mvc:exclude-mapping path="/basic/enterprise/**/info"/>
  112. <mvc:exclude-mapping path="/vendor/introduction/vendor/**" />
  113. <mvc:exclude-mapping path="/vendor/introduction/product/**" />
  114. <mvc:exclude-mapping path="/wx/**"/>
  115. <mvc:exclude-mapping path="/vote/one"/>
  116. <mvc:exclude-mapping path="/vote/all"/>
  117. <bean class="com.uas.platform.b2c.core.filter.SSOInterceptor"></bean>
  118. </mvc:interceptor>
  119. <!-- 对所有的请求拦截,将Session中的User信息设置进SystemSession -->
  120. <mvc:interceptor>
  121. <mvc:mapping path="/**"></mvc:mapping>
  122. <bean class="com.uas.platform.b2c.core.filter.SystemSessionInterceptor"></bean>
  123. </mvc:interceptor>
  124. <!-- 针对具体UAS用户,采用独立私钥签名、认证 -->
  125. <mvc:interceptor>
  126. <mvc:mapping path="/api/authed/**"></mvc:mapping>
  127. <mvc:mapping path="/api/trade/**"></mvc:mapping>
  128. <bean class="com.uas.platform.b2c.core.filter.AccessTokenInterceptor"></bean>
  129. </mvc:interceptor>
  130. </mvc:interceptors>
  131. <!-- spring swagger config -->
  132. <!--<bean class="com.mangofactory.swagger.configuration.SpringSwaggerConfig" />
  133. <bean class="com.uas.platform.b2c.core.support.SwaggerConfig" />-->
  134. </beans>