Browse Source

swagger未授权访问漏洞修复

develop
lau572 9 months ago
parent
commit
816a93e9c9
  1. 18
      ruoyi-common/src/main/java/com/ruoyi/common/utils/StakeMarkUtils.java
  2. 4
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java

18
ruoyi-common/src/main/java/com/ruoyi/common/utils/StakeMarkUtils.java

@ -4,13 +4,29 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
/**
* @Description 桩号距离计算工具
* @Description 桩号计算工具
*
* @author liuwenge
* @date 2024/1/17 14:43
*/
public class StakeMarkUtils {
/**
* @Description 桩号转公里数
*
* @author liuwenge
* @date 2024/3/6 11:06
* @param stakeMark 桩号:"K123+123"
* @return 公里数:123.123
*/
public BigDecimal format(String stakeMark){
if (StringUtils.isEmpty(stakeMark)){
return BigDecimal.ZERO;
}
String kilometre = stakeMark.toLowerCase().replace("k","").replace("+",".");
return new BigDecimal(kilometre);
}
/**
* @Description 计算桩号距离(公里)
*

4
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java

@ -126,8 +126,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
"/**/*.js",
"/profile/**"
).permitAll()
.antMatchers("/swagger-ui.html").anonymous()
.antMatchers("/swagger-resources/**").anonymous()
// .antMatchers("/swagger-ui.html").anonymous()
// .antMatchers("/swagger-resources/**").anonymous()
.antMatchers("/webjars/**").anonymous()
.antMatchers("/*/api-docs").anonymous()
.antMatchers("/druid/**").anonymous()

Loading…
Cancel
Save