Commit 1e631481 authored by tianyiming's avatar tianyiming

springsecrity

parent d72a4bff
package com.yeejoin.amos;
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;
@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();
}
}
......@@ -118,4 +118,9 @@ redis_equip_type_count = equipTypeAndCount
auth-key-fire-iot-equip=fire_iot-equip_info
# app离线同步装备数据开关
auth-open-fire-equip=false
\ No newline at end of file
auth-open-fire-equip=false
management.security.enabled=true
management.endpoint.health.show-details=always
spring.security.user.name=admin
spring.security.user.password=a1234560
\ No newline at end of file
package com.yeejoin.amos;
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;
@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();
}
}
......@@ -127,4 +127,8 @@ management.endpoints.enabled-by-default=false
#阿里云实时语音识别参数
speech-config.access-key-id=LTAI5t62oH95jgbjRiNXPsho
speech-config.access-key-secret=shy9SpogYgcdDoyTB3bvP21VSRmz8n
speech-config.app-key=FC84bGUpbNFrexoL
\ No newline at end of file
speech-config.app-key=FC84bGUpbNFrexoL
management.security.enabled=true
spring.security.user.name=admin
spring.security.user.password=a1234560
\ No newline at end of file
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