Commit 9b44cc39 authored by chenzhao's avatar chenzhao

修改代码

parent 149e6316
...@@ -29,6 +29,9 @@ public class GlobalResponseHandler implements ResponseBodyAdvice<Object> { ...@@ -29,6 +29,9 @@ public class GlobalResponseHandler implements ResponseBodyAdvice<Object> {
final static String SWAGGER_RESOURCES = "swagger"; final static String SWAGGER_RESOURCES = "swagger";
final static String CSRF = "csrf"; final static String CSRF = "csrf";
final static String ERROR = "error"; final static String ERROR = "error";
final static String ACTUATOR = "actuator";
final static String INSTANCES = "instances";
static LinkedList<String> filterUrl = new LinkedList<>(); static LinkedList<String> filterUrl = new LinkedList<>();
...@@ -36,6 +39,9 @@ public class GlobalResponseHandler implements ResponseBodyAdvice<Object> { ...@@ -36,6 +39,9 @@ public class GlobalResponseHandler implements ResponseBodyAdvice<Object> {
filterUrl.add(SWAGGER_URL); filterUrl.add(SWAGGER_URL);
filterUrl.add(SWAGGER_RESOURCES); filterUrl.add(SWAGGER_RESOURCES);
filterUrl.add(CSRF); filterUrl.add(CSRF);
filterUrl.add(ACTUATOR);
filterUrl.add(INSTANCES);
} }
/** /**
......
...@@ -31,8 +31,6 @@ amos.system.user.product=AMOS_STUDIO_WEB ...@@ -31,8 +31,6 @@ amos.system.user.product=AMOS_STUDIO_WEB
eureka.client.serviceUrl.defaultZone=http://172.16.10.72:10001/eureka/ eureka.client.serviceUrl.defaultZone=http://172.16.10.72:10001/eureka/
eureka.client.registry-fetch-interval-seconds=5 eureka.client.registry-fetch-interval-seconds=5
eureka.instance.prefer-ip-address=true eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url-path=/actuator/health eureka.instance.health-check-url-path=/actuator/health
eureka.instance.lease-expiration-duration-in-seconds=10 eureka.instance.lease-expiration-duration-in-seconds=10
eureka.instance.lease-renewal-interval-in-seconds=5 eureka.instance.lease-renewal-interval-in-seconds=5
...@@ -42,15 +40,39 @@ eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port} ...@@ -42,15 +40,39 @@ eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}
#redis #redis
#redis 基础配置
spring.redis.database=0 spring.redis.database=0
spring.redis.host=172.16.10.85 # 连接超时时长ms
spring.redis.port=6379 spring.redis.timeout=10000
spring.redis.password=amos2019Redis spring.redis.password=
spring.redis.jedis.pool.max-active=200 # 连接池最大连接数(使用负值表示没有限制)
spring.redis.jedis.pool.max-wait=-1 spring.redis.lettuce.pool.max-active=3
spring.redis.jedis.pool.max-idle=10 # 连接池中的最小空闲连接
spring.redis.jedis.pool.min-idle=0 spring.redis.lettuce.pool.min-idle=2
spring.redis.timeout=1000 # 连接池中的最大空闲连接
spring.redis.lettuce.pool.max-idle=3
# 连接池最大阻塞等待时间(使用负值表示没有限制)
spring.redis.lettuce.pool.max-wait=-1
#在关闭客户端连接之前等待任务处理完成的最长时间,在这之后,无论任务是否执行完成,都会被执行器关闭,默认100ms
spring.redis.lettuce.shutdown-timeout=100
#单机集群判断 cluster集群 single单机
spring.redis.mode=cluster
#redis 单机配置
#spring.redis.host=172.16.11.20
#spring.redis.port=6379
#集群配置
spring.redis.cluster.nodes=172.16.3.41:6381,172.16.3.41:6002
spring.redis.cluster.max-redirects=3
spring.redis.cluster.scan-interval=1000
spring.redis.cluster.read-mode=SLAVE
spring.redis.cluster.retry-attempts=3
spring.redis.cluster.failed-attempts=3
spring.redis.cluster.slave-connection-pool-size=64
spring.redis.cluster.master-connection-pool-size=64
spring.redis.cluster.retry-interval=1500
#picture upload #picture upload
windows.img.path = C:\\ windows.img.path = C:\\
linux.img.path = / linux.img.path = /
......
#DB properties:
spring.datasource.url=jdbc:mysql://172.16.10.66:3306/safety-business-3.0.1?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=root_123
spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver
spring.datasource.hikari.maxLifetime = 1765000
spring.datasource.hikari.maximum-pool-size = 10
spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1
#系统服务账号,用户后端服务调用
#security.password=a1234560
#security.loginId=fas_autosys
#
##应用product appkey
#security.productWeb=STUDIO_APP_WEB
#security.appKey =studio_normalapp_2681691
#security.password=a1234560
#security.loginId=fas_autosys
##应用product appkey
#security.productWeb=STUDIO_APP_WEB
#security.appKey =studio_normalapp_2681691
amos.system.user.user-name=fas_autosys
amos.system.user.password=a1234560
amos.system.user.app-key=studio_normalapp_2681691
amos.system.user.product=AMOS_STUDIO_WEB
eureka.client.serviceUrl.defaultZone=http://172.16.10.72:10001/eureka/
eureka.client.registry-fetch-interval-seconds=5
eureka.instance.prefer-ip-address=true
eureka.instance.health-check-url-path=/actuator/health
eureka.instance.lease-expiration-duration-in-seconds=10
eureka.instance.lease-renewal-interval-in-seconds=5
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/doc.html
#redis
spring.redis.database=0
spring.redis.host=172.16.10.85
spring.redis.port=6379
spring.redis.password=amos2019Redis
spring.redis.jedis.pool.max-active=200
spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=10
spring.redis.jedis.pool.min-idle=0
spring.redis.timeout=1000
spring.redis.mode=single
#picture upload
windows.img.path = C:\\
linux.img.path = /
file.uploadUrl=C:\\upload\\files\\
#picture read
file.readUrl=http://172.16.11.33:8085/file/getFile?in=
#jpush 推送开关
params.isPush=false
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.10.211:2883
emqx.client-user-name=super
emqx.client-password=a123456
emqx.max-inflight=1000
emqx.keep-alive-interval=10
#文件服务器地址
file.url=http://39.98.45.134:9000/
...@@ -3614,6 +3614,21 @@ ...@@ -3614,6 +3614,21 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="cz" id="2022-10-09-02">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</not>
</preConditions>
<comment>add data cb_data_dictionary</comment>
<sql>
ALTER TABLE `cb_fire_station`
MODIFY COLUMN `person_charge_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '负责人名称' AFTER `duty_room_telephone`
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
......
...@@ -44,6 +44,8 @@ Push.fegin.name=APPMESSAGEPUSHSERVICE ...@@ -44,6 +44,8 @@ Push.fegin.name=APPMESSAGEPUSHSERVICE
amos.flowWork.topic =/STATE_GRID/hazardManagement amos.flowWork.topic =/STATE_GRID/hazardManagement
amosRefresh.danger.topic =patrolDangerInsertOrUpdate amosRefresh.danger.topic =patrolDangerInsertOrUpdate
amosRefresh.patrol.topic =patrolCheckInsert amosRefresh.patrol.topic =patrolCheckInsert
#停止通过WEB公开所有端点
#management.endpoints.web.exposure.exclude=*
## redis失效时间 ## redis失效时间
redis.cache.failure.time=10800 redis.cache.failure.time=10800
...@@ -79,3 +81,4 @@ spring.boot.admin.client.username=admin ...@@ -79,3 +81,4 @@ spring.boot.admin.client.username=admin
spring.boot.admin.client.password=a1234560 spring.boot.admin.client.password=a1234560
management.security.enabled=false management.security.enabled=false
management.endpoints.web.exposure.include=* management.endpoints.web.exposure.include=*
personAgencyCode=STATE_GRID
\ No newline at end of file
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode}) and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})
</if> </if>
</where> </where>
order by b.id order by b.id DESC
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
......
package com.yeejoin.amos.jpush.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.firewall.DefaultHttpFirewall;
import org.springframework.security.web.firewall.HttpFirewall;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
// 授权
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.headers()
.frameOptions()
.disable()
.and()
.authorizeRequests()
.regexMatchers("^(?!/actuator).*$").permitAll()
.regexMatchers("/actuator/health").permitAll()
.regexMatchers("/actuator/info").permitAll()
.anyRequest().authenticated().and()
.formLogin();
}
@Bean
public HttpFirewall httpFirewall() {
return new DefaultHttpFirewall();
}
}
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