删除权限验证

duhanyu
dongdingding 1 year ago
parent 69b6362fe3
commit 336980d76c

@ -24,7 +24,7 @@ import java.util.List;
* @date 2023-10-13
*/
@RestController
@Api("词云")
@Api(tags = "词云")
@RequestMapping("/tcZz/netWorkYq/cy")
public class TcCyController extends BaseController {
@Autowired

@ -112,7 +112,7 @@ public class TcWljgController extends BaseController
/**
*
*/
@ApiOperation(value = "查询舆情走势图列表",response = TcWljg.class)
@ApiOperation(value = "查询网络监测列表",response = TcWljg.class)
@GetMapping("/ListNoToken")
public TableDataInfo ListNoToken(TcWljg tcWljg)
{

@ -30,7 +30,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @author ruoyi
* @date 2023-10-13
*/
@Api("舆情走势图")
@Api(tags = "舆情走势图")
@RestController
@RequestMapping("/tcZz/netWorkYq/yqzs")
public class TcYqzsController extends BaseController

@ -1,5 +1,9 @@
package com.ruoyi.framework.config;
import com.ruoyi.framework.config.properties.PermitAllUrlProperties;
import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter;
import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl;
import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpMethod;
@ -15,10 +19,6 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.authentication.logout.LogoutFilter;
import org.springframework.web.filter.CorsFilter;
import com.ruoyi.framework.config.properties.PermitAllUrlProperties;
import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter;
import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl;
import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
/**
* spring security
@ -26,8 +26,7 @@ import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
* @author ruoyi
*/
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
public class SecurityConfig extends WebSecurityConfigurerAdapter
{
public class SecurityConfig extends WebSecurityConfigurerAdapter {
/**
*
*/
@ -72,8 +71,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
*/
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception
{
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
@ -93,8 +91,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
* authenticated | 访
*/
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception
{
protected void configure(HttpSecurity httpSecurity) throws Exception {
// 注解标记允许匿名访问的url
ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry = httpSecurity.authorizeRequests();
permitAllUrl.getUrls().forEach(url -> registry.antMatchers(url).permitAll());
@ -113,13 +110,13 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/register", "/captchaImage").permitAll()
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**","/tcZz/cy/**n","/tcZz/yqzs/**",
"/tcZz/networkSecurity/cybersecurity/**","/tcZz/networkSecurity/xtjc/**",
"/tcZz/networkSecurity/jgdw/**","/tcZz/netWorkYq/yqxxltj/**","/tcZz/netWorkYq/yqxxltj/**",
"/tcZz/yqzs/ListNoToken","/tcZz/cy/ListNoToken",
"/tcZz/networkSecurity/cybersecurity/ListNoToken","/tcZz/networkSecurity/jgdw/ListNoToken",
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**",
"/tcZz/netWorkYq/yqzs/ListNoToken", "/tcZz/netWorkYq/cy/ListNoToken",
"/tcZz/networkSecurity/cybersecurity/ListNoToken", "/tcZz/networkSecurity/cybersecurity/ListNoToken",
"/tcZz/networkSecurity/jgdw/ListNoToken",
"/tcZz/networkSecurity/xtjc/ListNoToken", "/tcZz/netWorkYq/yqxxltj/ListNoToken").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**"
).permitAll()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated()
.and()
@ -137,8 +134,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
*
*/
@Bean
public BCryptPasswordEncoder bCryptPasswordEncoder()
{
public BCryptPasswordEncoder bCryptPasswordEncoder() {
return new BCryptPasswordEncoder();
}
@ -146,8 +142,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
*
*/
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception
{
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());
}
}

Loading…
Cancel
Save