64850858
2021-06-07 c82608125353a7cd96aa19c2c96ac7a40d1ec23f
src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java
@@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.conf.security;
import com.genersoft.iot.vmp.conf.UserSetup;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
@@ -22,8 +23,8 @@
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    @Value("${userSettings.interfaceAuthentication}")
    private boolean interfaceAuthentication;
    @Autowired
    private UserSetup userSetup;
    @Autowired
    private DefaultUserDetailsServiceImpl userDetailsService;
@@ -71,7 +72,7 @@
    @Override
    public void configure(WebSecurity web) {
        if (!interfaceAuthentication) {
        if (!userSetup.isInterfaceAuthentication()) {
            web.ignoring().antMatchers("**");
        }else {
            // 可以直接访问的静态数据