Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-common-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5cf40c8e
authored
Apr 10, 2023
by
黄超华
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
解决报错问题
1 parent
65b95690
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
8 deletions
platform-auth-api/src/main/java/cn/com/glsx/auth/utils/GatewayJwtUtils.java
platform-auth/src/main/resources/bootstrap.properties
platform-gateway/src/main/java/com/glsx/plat/Application.java
platform-gateway/src/main/java/com/glsx/plat/gateway/config/ApiGatewayConfig.java
platform-auth-api/src/main/java/cn/com/glsx/auth/utils/GatewayJwtUtils.java
View file @
5cf40c8
...
@@ -25,7 +25,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
...
@@ -25,7 +25,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
@Component
@Component
public
class
GatewayJwtUtils
implements
InitializingBean
{
public
class
GatewayJwtUtils
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
GatewayJwtUtils
.
class
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
GatewayJwtUtils
.
class
);
private
static
final
String
PAYLOAD_MAP
=
"payloadMap"
;
private
static
final
String
PAYLOAD_MAP
=
"payloadMap"
;
...
@@ -39,11 +39,6 @@ public class GatewayJwtUtils implements InitializingBean {
...
@@ -39,11 +39,6 @@ public class GatewayJwtUtils implements InitializingBean {
public
GatewayJwtUtils
()
{
public
GatewayJwtUtils
()
{
}
}
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
// GatewayService gatewayService = GatewayService.builder().name("scrm-shopmall")
// GatewayService gatewayService = GatewayService.builder().name("scrm-shopmall")
// .remark("scrm商城")
// .remark("scrm商城")
...
...
platform-auth/src/main/resources/bootstrap.properties
View file @
5cf40c8
#项目名称
#项目名称
spring.application.name
=
platform-auth
spring.application.name
=
platform-auth
server.servlet.context-
path
=
/
${spring.application.name}
server.servlet.context-
path
=
/
auth
server.port
=
8081
server.port
=
8081
#日志路径(logback-spring.xml读取,不要加入配置中心)
#日志路径(logback-spring.xml读取,不要加入配置中心)
logging.path
=
/data/java_log/jetty/${spring.application.name}/${spring.application.name}.log
logging.path
=
/data/java_log/jetty/${spring.application.name}/${spring.application.name}.log
...
...
platform-gateway/src/main/java/com/glsx/plat/Application.java
View file @
5cf40c8
...
@@ -17,7 +17,7 @@ import static java.util.TimeZone.getTimeZone;
...
@@ -17,7 +17,7 @@ import static java.util.TimeZone.getTimeZone;
*/
*/
@EnableDiscoveryClient
@EnableDiscoveryClient
@EnableFeignClients
(
basePackages
=
{
"cn.com.glsx.*.api"
})
@EnableFeignClients
(
basePackages
=
{
"cn.com.glsx.*.api"
})
@SpringBootApplication
(
exclude
=
DataSourceAutoConfiguration
.
class
)
@SpringBootApplication
(
scanBasePackages
=
{
"cn.com.glsx.*"
},
exclude
=
DataSourceAutoConfiguration
.
class
)
public
class
Application
{
public
class
Application
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
platform-gateway/src/main/java/com/glsx/plat/gateway/config/ApiGatewayConfig.java
View file @
5cf40c8
package
com
.
glsx
.
plat
.
gateway
.
config
;
package
com
.
glsx
.
plat
.
gateway
.
config
;
import
cn.com.glsx.auth.config.ApiGatewayServiceConfig
;
import
cn.com.glsx.auth.config.ApiGatewayServiceConfig
;
import
org.springframework.beans.factory.ObjectProvider
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConverters
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.cloud.gateway.config.GatewayProperties
;
import
org.springframework.cloud.gateway.config.GatewayProperties
;
import
org.springframework.cloud.gateway.event.EnableBodyCachingEvent
;
import
org.springframework.cloud.gateway.event.EnableBodyCachingEvent
;
import
org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter
;
import
org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
java.util.stream.Collectors
;
@Configuration
@Configuration
@EnableConfigurationProperties
({
ApiGatewayRetryConfig
.
class
,
ApiGatewayServiceConfig
.
class
})
@EnableConfigurationProperties
({
ApiGatewayRetryConfig
.
class
,
ApiGatewayServiceConfig
.
class
})
...
@@ -29,4 +35,10 @@ public class ApiGatewayConfig {
...
@@ -29,4 +35,10 @@ public class ApiGatewayConfig {
adaptCachedBodyGlobalFilter
.
onApplicationEvent
(
enableBodyCachingEvent
);
adaptCachedBodyGlobalFilter
.
onApplicationEvent
(
enableBodyCachingEvent
);
});
});
}
}
@Bean
@ConditionalOnMissingBean
public
HttpMessageConverters
messageConverters
(
ObjectProvider
<
HttpMessageConverter
<?>>
converters
)
{
return
new
HttpMessageConverters
(
converters
.
orderedStream
().
collect
(
Collectors
.
toList
()));
}
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment