diff --git a/mystyle-cloud-fiction/pom.xml b/mystyle-cloud-fiction/pom.xml
index e99f43c..b705132 100644
--- a/mystyle-cloud-fiction/pom.xml
+++ b/mystyle-cloud-fiction/pom.xml
@@ -56,6 +56,12 @@
org.springframework.cloud
spring-cloud-sleuth-zipkin
+
+
+ de.codecentric
+ spring-boot-admin-starter-client
+
+
\ No newline at end of file
diff --git a/mystyle-cloud-fiction/src/main/resources/application.yml b/mystyle-cloud-fiction/src/main/resources/application.yml
index 8be9565..635b34f 100644
--- a/mystyle-cloud-fiction/src/main/resources/application.yml
+++ b/mystyle-cloud-fiction/src/main/resources/application.yml
@@ -57,4 +57,15 @@ mystyle:
- /doc.html
- /webjars/**
#
- - /upload/decoToken
\ No newline at end of file
+ - /upload/decoToken
+ - /actuator/**
+ - /instances/**
+management:
+ endpoints:
+ web:
+ exposure:
+ include: '*'
+ endpoint:
+ health:
+ show-details: ALWAYS
+ enabled: true
\ No newline at end of file
diff --git a/mystyle-cloud-file/pom.xml b/mystyle-cloud-file/pom.xml
index 3ba7984..ab9aba7 100644
--- a/mystyle-cloud-file/pom.xml
+++ b/mystyle-cloud-file/pom.xml
@@ -101,5 +101,11 @@
com.artofsolving
jodconverter
+
+
+ de.codecentric
+ spring-boot-admin-starter-client
+
+
\ No newline at end of file
diff --git a/mystyle-cloud-file/src/main/resources/application.yml b/mystyle-cloud-file/src/main/resources/application.yml
index 7f8bdca..329448e 100644
--- a/mystyle-cloud-file/src/main/resources/application.yml
+++ b/mystyle-cloud-file/src/main/resources/application.yml
@@ -66,4 +66,15 @@ mystyle:
- /doc.html
- /webjars/**
#
- - /upload/decoToken
\ No newline at end of file
+ - /upload/decoToken
+ - /actuator/**
+ - /instances/**
+management:
+ endpoints:
+ web:
+ exposure:
+ include: '*'
+ endpoint:
+ health:
+ show-details: ALWAYS
+ enabled: true
\ No newline at end of file
diff --git a/mystyle-cloud-gateway/pom.xml b/mystyle-cloud-gateway/pom.xml
index 948b8c5..c065fba 100644
--- a/mystyle-cloud-gateway/pom.xml
+++ b/mystyle-cloud-gateway/pom.xml
@@ -52,6 +52,12 @@
spring-cloud-sleuth-zipkin
+
+ de.codecentric
+ spring-boot-admin-starter-client
+
+
+
diff --git a/mystyle-cloud-gateway/src/main/resources/application.yml b/mystyle-cloud-gateway/src/main/resources/application.yml
index 17c65c0..86bfc21 100644
--- a/mystyle-cloud-gateway/src/main/resources/application.yml
+++ b/mystyle-cloud-gateway/src/main/resources/application.yml
@@ -83,4 +83,13 @@ spring:
predicates:
- Path=/mystyle-cloud-admin-monitor/**
filters:
- - StripPrefix=1
\ No newline at end of file
+ - StripPrefix=1
+management:
+ endpoints:
+ web:
+ exposure:
+ include: '*'
+ endpoint:
+ health:
+ show-details: ALWAYS
+ enabled: true
diff --git a/mystyle-cloud-mail/pom.xml b/mystyle-cloud-mail/pom.xml
index 25e0eeb..9e1d185 100644
--- a/mystyle-cloud-mail/pom.xml
+++ b/mystyle-cloud-mail/pom.xml
@@ -52,5 +52,11 @@
org.springframework.cloud
spring-cloud-sleuth-zipkin
+
+
+ de.codecentric
+ spring-boot-admin-starter-client
+
+
\ No newline at end of file
diff --git a/mystyle-cloud-mail/src/main/java/com/zhangmeng/mail/config/ResourceServerConfig.java b/mystyle-cloud-mail/src/main/java/com/zhangmeng/mail/config/ResourceServerConfig.java
index 3c74de3..44fe73e 100644
--- a/mystyle-cloud-mail/src/main/java/com/zhangmeng/mail/config/ResourceServerConfig.java
+++ b/mystyle-cloud-mail/src/main/java/com/zhangmeng/mail/config/ResourceServerConfig.java
@@ -85,6 +85,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
http.authorizeRequests()
// 跨域预检请求
.antMatchers(HttpMethod.OPTIONS, "/**").permitAll()
+ .antMatchers(securityProperty.getOpenApi()).permitAll()
.anyRequest().
authenticated(); // 其他地址需要认证授权
}
diff --git a/mystyle-cloud-mail/src/main/resources/application.yml b/mystyle-cloud-mail/src/main/resources/application.yml
index ce8292b..20b3c57 100644
--- a/mystyle-cloud-mail/src/main/resources/application.yml
+++ b/mystyle-cloud-mail/src/main/resources/application.yml
@@ -62,4 +62,14 @@ mapper:
mystyle:
security:
open-api:
- - /
\ No newline at end of file
+ - /actuator/**
+ - /instances/**
+management:
+ endpoints:
+ web:
+ exposure:
+ include: '*'
+ endpoint:
+ health:
+ show-details: ALWAYS
+ enabled: true
\ No newline at end of file
diff --git a/mystyle-cloud-oauth/pom.xml b/mystyle-cloud-oauth/pom.xml
index bca9599..b234e22 100644
--- a/mystyle-cloud-oauth/pom.xml
+++ b/mystyle-cloud-oauth/pom.xml
@@ -75,6 +75,10 @@
mystyle-cloud-api
1.0-SNAPSHOT
+
+ de.codecentric
+ spring-boot-admin-starter-client
+
\ No newline at end of file
diff --git a/mystyle-cloud-oauth/src/main/java/com/zhangmeng/oauth/config/SecurityProperty.java b/mystyle-cloud-oauth/src/main/java/com/zhangmeng/oauth/config/SecurityProperty.java
new file mode 100644
index 0000000..3c8e06b
--- /dev/null
+++ b/mystyle-cloud-oauth/src/main/java/com/zhangmeng/oauth/config/SecurityProperty.java
@@ -0,0 +1,79 @@
+package com.zhangmeng.oauth.config;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @author 转身的背影在心底里沉沦
+ * @date 2021年9月14日16:50:47
+ * @version 1.0
+ * */
+@Configuration
+@ConfigurationProperties("mystyle.security")
+public class SecurityProperty {
+
+ /**
+ * 超级管理员不认证
+ * */
+ private boolean superAuthOpen;
+
+ /**
+ * 不验证权限用户名
+ * */
+ private String superAdmin;
+
+ /**
+ * 记住密码标识
+ * */
+ private String rememberKey;
+
+ /**
+ * 开放接口列表
+ * */
+ private String[] openApi;
+
+ /**
+ * 是否允许多账号在线
+ * */
+ private Integer maximum = 1;
+
+ public boolean isSuperAuthOpen() {
+ return superAuthOpen;
+ }
+
+ public void setSuperAuthOpen(boolean superAuthOpen) {
+ this.superAuthOpen = superAuthOpen;
+ }
+
+ public String getSuperAdmin() {
+ return superAdmin;
+ }
+
+ public void setSuperAdmin(String superAdmin) {
+ this.superAdmin = superAdmin;
+ }
+
+ public String getRememberKey() {
+ return rememberKey;
+ }
+
+ public void setRememberKey(String rememberKey) {
+ this.rememberKey = rememberKey;
+ }
+
+ public String[] getOpenApi() {
+ return openApi;
+ }
+
+ public void setOpenApi(String[] openApi) {
+ this.openApi = openApi;
+ }
+
+ public Integer getMaximum() {
+ return maximum;
+ }
+
+ public void setMaximum(Integer maximum) {
+ this.maximum = maximum;
+ }
+}
diff --git a/mystyle-cloud-oauth/src/main/java/com/zhangmeng/oauth/config/WebSecurityConfig.java b/mystyle-cloud-oauth/src/main/java/com/zhangmeng/oauth/config/WebSecurityConfig.java
index 8a841e9..432bf90 100644
--- a/mystyle-cloud-oauth/src/main/java/com/zhangmeng/oauth/config/WebSecurityConfig.java
+++ b/mystyle-cloud-oauth/src/main/java/com/zhangmeng/oauth/config/WebSecurityConfig.java
@@ -1,5 +1,6 @@
package com.zhangmeng.oauth.config;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
@@ -18,6 +19,10 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Order(-1)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
+
+ @Autowired
+ private SecurityProperty securityProperty;
+
/***
* 采用BCryptPasswordEncoder对密码进行编码
* @return
@@ -35,11 +40,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
public void configure(WebSecurity web) throws Exception {
// 对静态资源放行
- web.ignoring().antMatchers(
- "/user/login",
- "/user/logout",
- "/oauth/login","/user/oauth/parseToken"
- );
+ web.ignoring().antMatchers(securityProperty.getOpenApi());
}
/***
diff --git a/mystyle-cloud-oauth/src/main/resources/application.yml b/mystyle-cloud-oauth/src/main/resources/application.yml
index 53d5329..93f1244 100644
--- a/mystyle-cloud-oauth/src/main/resources/application.yml
+++ b/mystyle-cloud-oauth/src/main/resources/application.yml
@@ -52,4 +52,22 @@ feign:
config:
default:
connect-timeout: 20000
- read-timeout: 20000
\ No newline at end of file
+ read-timeout: 20000
+mystyle:
+ security:
+ open-api:
+ - /user/login
+ - /user/logout
+ - /oauth/login
+ - /user/oauth/parseToken
+ - /actuator/**
+ - /instances/**
+management:
+ endpoints:
+ web:
+ exposure:
+ include: '*'
+ endpoint:
+ health:
+ show-details: ALWAYS
+ enabled: true
\ No newline at end of file
diff --git a/mystyle-cloud-quartz/pom.xml b/mystyle-cloud-quartz/pom.xml
index 981a0a8..c657f1b 100644
--- a/mystyle-cloud-quartz/pom.xml
+++ b/mystyle-cloud-quartz/pom.xml
@@ -51,5 +51,11 @@
org.springframework.cloud
spring-cloud-sleuth-zipkin
+
+
+ de.codecentric
+ spring-boot-admin-starter-client
+
+
\ No newline at end of file
diff --git a/mystyle-cloud-quartz/src/main/java/com/zhangmeng/quartz/config/ResourceServerConfig.java b/mystyle-cloud-quartz/src/main/java/com/zhangmeng/quartz/config/ResourceServerConfig.java
index 66e7beb..1f5c9ad 100644
--- a/mystyle-cloud-quartz/src/main/java/com/zhangmeng/quartz/config/ResourceServerConfig.java
+++ b/mystyle-cloud-quartz/src/main/java/com/zhangmeng/quartz/config/ResourceServerConfig.java
@@ -85,6 +85,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
http.authorizeRequests()
// 跨域预检请求
.antMatchers(HttpMethod.OPTIONS, "/**").permitAll()
+ .antMatchers(securityProperty.getOpenApi()).permitAll()
.anyRequest().
authenticated(); // 其他地址需要认证授权
}
diff --git a/mystyle-cloud-quartz/src/main/resources/application.yml b/mystyle-cloud-quartz/src/main/resources/application.yml
index e97d591..bce577d 100644
--- a/mystyle-cloud-quartz/src/main/resources/application.yml
+++ b/mystyle-cloud-quartz/src/main/resources/application.yml
@@ -65,4 +65,18 @@ mapper:
style: normal
enum-as-simple-type: true
identity: MYSQL
- check-example-entity-class: true
\ No newline at end of file
+ check-example-entity-class: true
+mystyle:
+ security:
+ open-api:
+ - /actuator/**
+ - /instances/**
+management:
+ endpoints:
+ web:
+ exposure:
+ include: '*'
+ endpoint:
+ health:
+ show-details: ALWAYS
+ enabled: true