package com.macro.mall.portal.config;

import com.macro.mall.portal.service.UmsMemberService;
import com.macro.mall.security.component.DynamicSecurityService;
import com.macro.mall.security.config.SecurityConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.core.userdetails.UserDetailsService;

import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * mall-security模块相关配置
 * Created by macro on 2019/11/5.
 */
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class MallSecurityConfig extends SecurityConfig {

    @Autowired
    private UmsMemberService memberService;

    @Bean
    public UserDetailsService userDetailsService() {
        //获取登录用户信息
        return username -> memberService.loadUserByUsername(username);
    }
}

@@ -91,73 +91,8 @@
 ce;%0A
-import com.macro.mall.security.component.DynamicSecurityService;%0A
 impo
@@ -141,16 +141,16 @@
 Config;%0A
+
 import o
@@ -321,68 +321,8 @@
 on;%0A
-import org.springframework.security.access.ConfigAttribute;%0A
 impo
@@ -503,32 +503,32 @@
 bleWebSecurity;%0A
+
 import org.sprin
@@ -589,107 +589,8 @@
 e;%0A%0A
-import java.util.Collection;%0Aimport java.util.Map;%0Aimport java.util.concurrent.ConcurrentHashMap;%0A%0A
 /**%0A

Update MallSecurityConfig.java