yonge 3 年之前
父節點
當前提交
5e3fba4ac3

+ 1 - 1
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/web/config/PermissionCheckService.java → cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/config/PermissionCheckService.java

@@ -1,4 +1,4 @@
-package com.yonge.cooleshow.web.config;
+package com.yonge.cooleshow.admin.config;
 
 import java.util.Collection;
 

+ 7 - 10
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/config/ResourceServerConfig.java

@@ -1,7 +1,5 @@
 package com.yonge.cooleshow.admin.config;
 
-import com.yonge.cooleshow.common.security.BaseAccessDeniedHandler;
-import com.yonge.cooleshow.common.security.BaseAuthenticationEntryPoint;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
@@ -10,6 +8,9 @@ import org.springframework.security.oauth2.config.annotation.web.configuration.E
 import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
 import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
 
+import com.yonge.cooleshow.common.security.BaseAccessDeniedHandler;
+import com.yonge.cooleshow.common.security.BaseAuthenticationEntryPoint;
+
 @Configuration
 @EnableResourceServer
 @EnableGlobalMethodSecurity(prePostEnabled = true)
@@ -23,14 +24,10 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 
 	@Override
 	public void configure(HttpSecurity http) throws Exception {
-		http.csrf()
-				.disable()
-				.exceptionHandling()
-				.accessDeniedHandler(baseAccessDeniedHandler)
-				.authenticationEntryPoint(baseAuthenticationEntryPoint)
-				.and()
-				.authorizeRequests()
-				.antMatchers("/v2/api-docs", "/code/*").permitAll().anyRequest().authenticated().and().httpBasic();
+		http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and()
+				.authorizeRequests().antMatchers("/task/**").hasIpAddress("0.0.0.0/0")
+				.antMatchers("/v2/api-docs", "/code/*", "/api/*", "/appVersionInfo/queryByPlatform", "/uploadFile").permitAll().anyRequest().authenticated()
+				.and().httpBasic();
 	}
 
 	@Override

+ 2 - 2
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/web/config/WebMvcConfig.java → cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/config/WebMvcConfig.java

@@ -1,4 +1,4 @@
-package com.yonge.cooleshow.web.config;
+package com.yonge.cooleshow.admin.config;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -12,9 +12,9 @@ import org.springframework.http.MediaType;
 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
+import com.yonge.cooleshow.admin.interceptor.OperationLogInterceptor;
 import com.yonge.cooleshow.common.config.EnumConverterFactory;
 import com.yonge.cooleshow.common.config.LocalFastJsonHttpMessageConverter;
-import com.yonge.cooleshow.web.interceptor.OperationLogInterceptor;
 
 @Configuration
 public class WebMvcConfig implements WebMvcConfigurer {

+ 1 - 1
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/web/controller/AppVersionInfoController.java → cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/AppVersionInfoController.java

@@ -1,4 +1,4 @@
-package com.yonge.cooleshow.web.controller;
+package com.yonge.cooleshow.admin.controller;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;

+ 1 - 1
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/web/controller/SmsCodeController.java → cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/SmsCodeController.java

@@ -1,4 +1,4 @@
-package com.yonge.cooleshow.web.controller;
+package com.yonge.cooleshow.admin.controller;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;

+ 1 - 1
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/web/controller/SubjectController.java → cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/SubjectController.java

@@ -1,4 +1,4 @@
-package com.yonge.cooleshow.web.controller;
+package com.yonge.cooleshow.admin.controller;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;

+ 1 - 1
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/web/controller/SysSuggestionController.java → cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/SysSuggestionController.java

@@ -1,4 +1,4 @@
-package com.yonge.cooleshow.web.controller;
+package com.yonge.cooleshow.admin.controller;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;

+ 1 - 1
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/web/controller/SysUserContractsController.java → cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/SysUserContractsController.java

@@ -1,4 +1,4 @@
-package com.yonge.cooleshow.web.controller;
+package com.yonge.cooleshow.admin.controller;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;

+ 1 - 1
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/web/controller/UploadFileController.java → cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/UploadFileController.java

@@ -1,4 +1,4 @@
-package com.yonge.cooleshow.web.controller;
+package com.yonge.cooleshow.admin.controller;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiParam;

+ 1 - 1
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/web/interceptor/OperationLogInterceptor.java → cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/interceptor/OperationLogInterceptor.java

@@ -1,4 +1,4 @@
-package com.yonge.cooleshow.web.interceptor;
+package com.yonge.cooleshow.admin.interceptor;
 
 import java.io.IOException;
 

+ 0 - 38
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/web/config/ResourceServerConfig.java

@@ -1,38 +0,0 @@
-package com.yonge.cooleshow.web.config;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
-import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
-import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
-
-import com.yonge.cooleshow.common.security.BaseAccessDeniedHandler;
-import com.yonge.cooleshow.common.security.BaseAuthenticationEntryPoint;
-
-@Configuration
-@EnableResourceServer
-@EnableGlobalMethodSecurity(prePostEnabled = true)
-public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
-
-	@Autowired
-	private BaseAccessDeniedHandler baseAccessDeniedHandler;
-
-	@Autowired
-	private BaseAuthenticationEntryPoint baseAuthenticationEntryPoint;
-
-	@Override
-	public void configure(HttpSecurity http) throws Exception {
-		http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and()
-				.authorizeRequests().antMatchers("/task/**").hasIpAddress("0.0.0.0/0")
-				.antMatchers("/v2/api-docs", "/code/*", "/api/*", "/appVersionInfo/queryByPlatform", "/uploadFile").permitAll().anyRequest().authenticated()
-				.and().httpBasic();
-	}
-
-	@Override
-	public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
-		resources.authenticationEntryPoint(baseAuthenticationEntryPoint).accessDeniedHandler(baseAccessDeniedHandler);
-	}
-
-}