Commit 985353a0 by 袁伟铭

修改pom

parent 7e91925a
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
<artifactId>api-server</artifactId> <artifactId>api-server</artifactId>
<name>API服务</name>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.zq</groupId> <groupId>com.zq</groupId>
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
<artifactId>civil-common-utils</artifactId> <artifactId>civil-common-utils</artifactId>
<name>公共模块</name>
<properties> <properties>
<http.client.version>4.5.12</http.client.version> <http.client.version>4.5.12</http.client.version>
</properties> </properties>
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
<artifactId>config-server</artifactId> <artifactId>config-server</artifactId>
<name>配置中心</name>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
<artifactId>eureka-server</artifactId> <artifactId>eureka-server</artifactId>
<name>注册中心</name>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
<artifactId>file-server</artifactId> <artifactId>file-server</artifactId>
<name>文件服务</name>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.zq</groupId> <groupId>com.zq</groupId>
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
<artifactId>gateway-server</artifactId> <artifactId>gateway-server</artifactId>
<name>网关服务</name>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<artifactId>civil-bigdata</artifactId> <artifactId>civil-bigdata</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>1.0.0</version> <version>1.0.0</version>
<name>父工程</name>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
...@@ -26,7 +27,7 @@ ...@@ -26,7 +27,7 @@
<pagehelper.version>5.2.0</pagehelper.version> <pagehelper.version>5.2.0</pagehelper.version>
<jjwt.version>0.9.1</jjwt.version> <jjwt.version>0.9.1</jjwt.version>
<fastjson.version>1.2.76</fastjson.version> <fastjson.version>1.2.76</fastjson.version>
<hutool.version>5.3.4</hutool.version> <hutool.version>5.7.7</hutool.version>
</properties> </properties>
<modules> <modules>
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
<artifactId>portal-server</artifactId> <artifactId>portal-server</artifactId>
<name>门户服务</name>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.zq</groupId> <groupId>com.zq</groupId>
......
...@@ -74,13 +74,11 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -74,13 +74,11 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
Map<RequestMappingInfo, HandlerMethod> handlerMethodMap = requestMappingHandlerMapping.getHandlerMethods(); Map<RequestMappingInfo, HandlerMethod> handlerMethodMap = requestMappingHandlerMapping.getHandlerMethods();
// 获取匿名标记 // 获取匿名标记
Map<String, Set<String>> anonymousUrls = getAnonymousUrl(handlerMethodMap); Map<String, Set<String>> anonymousUrls = getAnonymousUrl(handlerMethodMap);
Set<String> apiSet = new HashSet<>(); Set<String> allType = anonymousUrls.get(RequestMethodEnum.ALL.getType());
//不使用注解的时候在这添加url放行 //不使用注解的时候在这添加url放行
apiSet.add("/static/map/**"); allType.add("/static/map/**");
apiSet.add("/portal/app/**"); allType.add("/portal/app/**");
apiSet.add("/**");
anonymousUrls.put("API", apiSet);
httpSecurity httpSecurity
// 禁用 CSRF // 禁用 CSRF
.csrf().disable() .csrf().disable()
...@@ -133,9 +131,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -133,9 +131,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
// DELETE // DELETE
.antMatchers(HttpMethod.DELETE, anonymousUrls.get(RequestMethodEnum.DELETE.getType()).toArray(new String[0])).permitAll() .antMatchers(HttpMethod.DELETE, anonymousUrls.get(RequestMethodEnum.DELETE.getType()).toArray(new String[0])).permitAll()
// 所有类型的接口都放行 // 所有类型的接口都放行
.antMatchers(anonymousUrls.get(RequestMethodEnum.ALL.getType()).toArray(new String[0])).permitAll() .antMatchers(allType.toArray(new String[0])).permitAll()
// API接口放行
.antMatchers(anonymousUrls.get("API").toArray(new String[0])).permitAll()
// 所有请求都需要认证 // 所有请求都需要认证
.anyRequest().authenticated() .anyRequest().authenticated()
.and().apply(securityConfigurerAdapter()); .and().apply(securityConfigurerAdapter());
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
<artifactId>resource-server</artifactId> <artifactId>resource-server</artifactId>
<name>资源目录管理</name>
<properties> <properties>
<maven.compiler.source>8</maven.compiler.source> <maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target> <maven.compiler.target>8</maven.compiler.target>
......
...@@ -74,11 +74,10 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -74,11 +74,10 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
Map<RequestMappingInfo, HandlerMethod> handlerMethodMap = requestMappingHandlerMapping.getHandlerMethods(); Map<RequestMappingInfo, HandlerMethod> handlerMethodMap = requestMappingHandlerMapping.getHandlerMethods();
// 获取匿名标记 // 获取匿名标记
Map<String, Set<String>> anonymousUrls = getAnonymousUrl(handlerMethodMap); Map<String, Set<String>> anonymousUrls = getAnonymousUrl(handlerMethodMap);
Set<String> apiSet = new HashSet<>(); Set<String> allType = anonymousUrls.get(RequestMethodEnum.ALL.getType());
//不使用注解的时候在这添加url放行 //不使用注解的时候在这添加url放行
apiSet.add("/user/app/**"); allType.add("/resource/app/**");
anonymousUrls.put("API", apiSet);
httpSecurity httpSecurity
// 禁用 CSRF // 禁用 CSRF
.csrf().disable() .csrf().disable()
...@@ -131,9 +130,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -131,9 +130,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
// DELETE // DELETE
.antMatchers(HttpMethod.DELETE, anonymousUrls.get(RequestMethodEnum.DELETE.getType()).toArray(new String[0])).permitAll() .antMatchers(HttpMethod.DELETE, anonymousUrls.get(RequestMethodEnum.DELETE.getType()).toArray(new String[0])).permitAll()
// 所有类型的接口都放行 // 所有类型的接口都放行
.antMatchers(anonymousUrls.get(RequestMethodEnum.ALL.getType()).toArray(new String[0])).permitAll() .antMatchers(allType.toArray(new String[0])).permitAll()
// API接口放行
.antMatchers(anonymousUrls.get("API").toArray(new String[0])).permitAll()
// 所有请求都需要认证 // 所有请求都需要认证
.anyRequest().authenticated() .anyRequest().authenticated()
.and().apply(securityConfigurerAdapter()); .and().apply(securityConfigurerAdapter());
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
<artifactId>sync-server</artifactId> <artifactId>sync-server</artifactId>
<name>同步服务</name>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.zq</groupId> <groupId>com.zq</groupId>
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
<artifactId>sys-server</artifactId> <artifactId>sys-server</artifactId>
<name>系统服务</name>
<properties> <properties>
<mapstruct.version>1.3.1.Final</mapstruct.version> <mapstruct.version>1.3.1.Final</mapstruct.version>
<alipay.version>4.9.153.ALL</alipay.version> <alipay.version>4.9.153.ALL</alipay.version>
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
<artifactId>user-server</artifactId> <artifactId>user-server</artifactId>
<name>用户服务</name>
<properties> <properties>
<maven.compiler.source>8</maven.compiler.source> <maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target> <maven.compiler.target>8</maven.compiler.target>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment