diff --git a/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayAuthenticationQueryFilter.java b/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayAuthenticationQueryFilter.java index a10b10d2342ed14bc1851f69283e1b103a524aa8..09630ae16930719a9fab8edba1c6e936169ac68d 100644 --- a/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayAuthenticationQueryFilter.java +++ b/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayAuthenticationQueryFilter.java @@ -43,6 +43,7 @@ public class XgatewayAuthenticationQueryFilter implements Filter { AuthenticationParam authenticationParam = null; if (attribute.getIsPublicUrl()) { filterChain.doFilter(servletRequest, servletResponse); + return; } authenticationParam = getAuthenticationParamByHttpServletRequest(((HttpServletRequest) servletRequest)); if (authenticationParam != null) { diff --git a/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayAuthenticationValidateFilter.java b/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayAuthenticationValidateFilter.java index 38a925fad5136d70ed302e45ddca13d20bfc474c..793a30c127c280ec8264eecf0f25ff352e440a20 100644 --- a/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayAuthenticationValidateFilter.java +++ b/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayAuthenticationValidateFilter.java @@ -30,6 +30,7 @@ public class XgatewayAuthenticationValidateFilter implements Filter { AuthenticationResult authenticationResult = attribute.getAuthenticationResult(); if (attribute.getIsPublicUrl()){ chain.doFilter(request,response); + return; } if (authenticationResult == null || StringUtils.isEmpty(authenticationResult.getUsername()) @@ -37,6 +38,7 @@ public class XgatewayAuthenticationValidateFilter implements Filter { HttpServletResponse httpServletResponse = (HttpServletResponse) response; removeCookie(httpServletResponse); ResponseUtils.unAuth((HttpServletResponse) response,"未获取到资源访问的认证身份"); + return; } chain.doFilter(request,response); } diff --git a/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayAuthorizationValidateFilter.java b/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayAuthorizationValidateFilter.java index 51aa9256d47b2f52e71adf5d06d2d230fdf891b3..4c2cd857fe529fc0365ed80ddb32004925c31bfc 100644 --- a/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayAuthorizationValidateFilter.java +++ b/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayAuthorizationValidateFilter.java @@ -42,6 +42,7 @@ public class XgatewayAuthorizationValidateFilter implements Filter { ExchangeAuthenticationAttribute attribute = ((ExchangeAuthenticationAttribute) request.getAttribute(EXCHANGE_AUTHENTICATION_ATTRIBUTE_NAME)); if (attribute.getIsPublicUrl() || attribute.getIsIndexUrl()){ chain.doFilter(request, response); + return; }else{ AuthenticationResult authenticationResult = attribute.getAuthenticationResult(); AuthorizationParam authorizationParam = new AuthorizationParam(); diff --git a/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayRequestTokenFilter.java b/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayRequestTokenFilter.java index 733f5103665b4611ec1d2871a9f8190d72bdb017..d78cde0c015205e2f07d163ed2a30c4a1063fd62 100644 --- a/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayRequestTokenFilter.java +++ b/gaf-boot/src/main/java/com/supermap/gaf/boot/filter/XgatewayRequestTokenFilter.java @@ -30,6 +30,7 @@ public class XgatewayRequestTokenFilter implements Filter { AuthenticationResult authenticationResult = attribute.getAuthenticationResult(); if (attribute.getIsPublicUrl()) { chain.doFilter(httpServletRequest, response); + return; } if (null != authenticationResult && !StringUtils.isEmpty(authenticationResult.getJwtToken())) { String token = authenticationResult.getJwtToken(); @@ -38,6 +39,7 @@ public class XgatewayRequestTokenFilter implements Filter { requestWrapper.putHeader(AUTHORIZATION, BEARER + " " + token); requestWrapper.putHeader("SourceHost", httpServletRequest.getHeader("Host")); chain.doFilter(requestWrapper, response); + return; } chain.doFilter(httpServletRequest, response); } diff --git a/gaf-boot/src/main/resources/application-default.yml b/gaf-boot/src/main/resources/application-default.yml index ea631fa17f754dbcf1ba64d226ad4e93845a664a..b808b31f9bf0ed6b1707192b5e5aa9f0e35f220f 100644 --- a/gaf-boot/src/main/resources/application-default.yml +++ b/gaf-boot/src/main/resources/application-default.yml @@ -1,11 +1,13 @@ +server: + port: 8888 spring: application: name: gaf-boot datasource: - driver-class-name: org.postgresql.Driver - username: admin - password: 123456 - url: jdbc:postgresql://192.168.11.118:32222/gafboottest + driver-class-name: ${GAF_ENV_DATASOURCE_DRIVER:org.postgresql.Driver} + username: ${GAF_ENV_DATASOURCE_USERNAME:postgres} + password: ${GAF_ENV_DATASOURCE_PASSWORD:root} + url: ${GAF_ENV_DATASOURCE_URL:jdbc:postgresql://localhost:5432/postgres} redis: database: 5 host: ${GAF_ENV_REDIS_HOST:localhost} @@ -136,4 +138,4 @@ supermap: gaf: s3m-threads-num: 4 #################################################gaf-analysis############################## -spiOverlayPath: C:/Users/C/Desktop \ No newline at end of file +spiOverlayPath: C:/Users/C/Desktop diff --git a/gaf-cloud/gaf-ops/gaf-sys-mgt/gaf-sys-mgt-service/src/main/java/com/supermap/gaf/sys/mgt/resource/SysResourceDatasourceResource.java b/gaf-cloud/gaf-ops/gaf-sys-mgt/gaf-sys-mgt-service/src/main/java/com/supermap/gaf/sys/mgt/resource/SysResourceDatasourceResource2.java similarity index 99% rename from gaf-cloud/gaf-ops/gaf-sys-mgt/gaf-sys-mgt-service/src/main/java/com/supermap/gaf/sys/mgt/resource/SysResourceDatasourceResource.java rename to gaf-cloud/gaf-ops/gaf-sys-mgt/gaf-sys-mgt-service/src/main/java/com/supermap/gaf/sys/mgt/resource/SysResourceDatasourceResource2.java index df5534298cc918d4c309991d60c2bab46519079c..f615593c3befbf54393c106930fef5cc054564cb 100644 --- a/gaf-cloud/gaf-ops/gaf-sys-mgt/gaf-sys-mgt-service/src/main/java/com/supermap/gaf/sys/mgt/resource/SysResourceDatasourceResource.java +++ b/gaf-cloud/gaf-ops/gaf-sys-mgt/gaf-sys-mgt-service/src/main/java/com/supermap/gaf/sys/mgt/resource/SysResourceDatasourceResource2.java @@ -32,7 +32,7 @@ import java.util.List; */ @Component @Api(value = "数据源接口") -public class SysResourceDatasourceResource { +public class SysResourceDatasourceResource2 { @Autowired private SysResourceDatasourceClient sysResourceDatasourceClient; diff --git a/gaf-cloud/gaf-ops/gaf-sys-mgt/gaf-sys-mgt-service/src/main/java/com/supermap/gaf/sys/mgt/resource/root/RootResource.java b/gaf-cloud/gaf-ops/gaf-sys-mgt/gaf-sys-mgt-service/src/main/java/com/supermap/gaf/sys/mgt/resource/root/RootResource.java index 173db3b454a352b4dd99b0d862074288ed63f52d..0e71810fa093e8aca74a593650c926aac5492b00 100644 --- a/gaf-cloud/gaf-ops/gaf-sys-mgt/gaf-sys-mgt-service/src/main/java/com/supermap/gaf/sys/mgt/resource/root/RootResource.java +++ b/gaf-cloud/gaf-ops/gaf-sys-mgt/gaf-sys-mgt-service/src/main/java/com/supermap/gaf/sys/mgt/resource/root/RootResource.java @@ -7,7 +7,7 @@ package com.supermap.gaf.sys.mgt.resource.root; import com.supermap.gaf.sys.mgt.resource.SysCatalogResource; import com.supermap.gaf.sys.mgt.resource.SysDictResource; -import com.supermap.gaf.sys.mgt.resource.SysResourceDatasourceResource; +import com.supermap.gaf.sys.mgt.resource.SysResourceDatasourceResource2; import io.swagger.annotations.Api; import javax.ws.rs.Path; @@ -31,8 +31,8 @@ public class RootResource { } @Path("/sys-resource-datasources") - public Class sysResourceDatasourceResource() { - return SysResourceDatasourceResource.class; + public Class sysResourceDatasourceResource2() { + return SysResourceDatasourceResource2.class; } } diff --git a/gaf-web/gaf-webapp/project.config.json b/gaf-web/gaf-webapp/project.config.json index 2c74f248ec2f3893137f7bc66d241d0b735cccee..f6b7f48b4cc9c3f8ea79323dec18f74813a14dd1 100644 --- a/gaf-web/gaf-webapp/project.config.json +++ b/gaf-web/gaf-webapp/project.config.json @@ -1,8 +1,8 @@ { - "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsicmlkIl0sInVzZXJfbmFtZSI6InN5c19hZG1pbiIsInNjb3BlIjpbImFsbCJdLCJleHAiOjE2NTAwOTY1OTgsIm1lc3NhZ2UiOiJoZWxsbyB3b3JsZCIsImF1dGhvcml0aWVzIjpbIlJPTEVfQ1VTVE9NX0FDQ0VTU19VU0VSIl0sImp0aSI6IjM1ZjM2YTdhLTZhYjMtNDM5My04M2JlLWNiZGNjMTU5NWRjNiIsImNsaWVudF9pZCI6ImN1c3RvbV9jbGllbnQiLCJ1c2VybmFtZSI6InN5c19hZG1pbiJ9.7QdwaPmXCGFWeVLzrDbMTXfeFJjgV4hpWldOkgytp_w", + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsicmlkIl0sInVzZXJfbmFtZSI6InN5c19hZG1pbiIsInNjb3BlIjpbImFsbCJdLCJleHAiOjE2NTA4NjQ1MDAsIm1lc3NhZ2UiOiJoZWxsbyB3b3JsZCIsImF1dGhvcml0aWVzIjpbIlJPTEVfQ1VTVE9NX0FDQ0VTU19VU0VSIl0sImp0aSI6IjgxZmZmNDU0LTdmOTYtNDQzNy04NzdmLTdlMzY0MzM4MWQyMCIsImNsaWVudF9pZCI6ImN1c3RvbV9jbGllbnQiLCJ1c2VybmFtZSI6InN5c19hZG1pbiJ9.d5i6lBsEsmwP7pl_GvuaExwJbh-peb0c2qG58Ie2Sgs", "proxy": { "/api/": { - "target": "http://localhost:5000/", + "target": "http://localhost:8888/", "pathRewrite": { "^/api/": "" }, diff --git a/initdb.bat b/initdb.bat index f6900b65b6d03c1abac38d08251c90401d3c61f1..8b6f89299ca17d25eea249122ec623b01ae7a83b 100644 --- a/initdb.bat +++ b/initdb.bat @@ -2,6 +2,6 @@ java -version set url=jdbc:postgresql://localhost:5432/postgres set user=postgres set password=root -set cl=classpath:com/supermap/gaf/base/data/entry/gaf-storage.xml +set cl=classpath:com/supermap/gaf/base/data/entry/gaf-cloud-base.xml set args=-url %url% -user %user% -password %password% -cl %cl% java -classpath "./gaf-cloud/gaf-commons/gaf-common-base-data/target/*;./initdb.jar" com.supermap.gaf.db.Main %args%