./app/index.scss中的错误找不到模块:错误:无法解析C:\ Users\johnliang\Temp\webpack-angular中的'file'或'directory'./../node_modules css-loader/index.js/app @ ./app/index.scss 4:14-116 13:2-17:4 14:20-122
./app/index.scss中的错误找不到模块:错误:无法解析C:\ Users\johnliang\Temp\webpack-angular中的'file'或'directory'./../node_modules style-loader/addStyles.js/app @ ./app/index.scss 7:13-68
index.scss未加载到最终的webpack输出中.
我有一个使用 ng2-stomp-service 的 Angular 2 应用程序。它与 Spring WebSocket 一起使用,但没有安全性。
但我无法将身份验证凭据发送到 Spring Security。这是 Spring Security 中的配置:
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf().disable()
.httpBasic()
.and()
.authorizeRequests()
.antMatchers("/demo-websocket/info").permitAll()
.antMatchers("/demo-websocket/**/websocket").permitAll()
.antMatchers("/info", "/health").permitAll()
.antMatchers("/info", "/health").permitAll()
.antMatchers("/api/**", "/advisor").hasRole("USER")
.anyRequest().authenticated();
}
}
Run Code Online (Sandbox Code Playgroud)
这是 Spring WebSocket 安全设置:
@Configuration
public class WebSocketSecurityConfig extends AbstractSecurityWebSocketMessageBrokerConfigurer {
@Override
protected void configureInbound(MessageSecurityMetadataSourceRegistry registry) {
registry
.simpTypeMatchers(CONNECT).permitAll()
.simpTypeMatchers(UNSUBSCRIBE, DISCONNECT).permitAll()
.simpMessageDestMatchers("/app/**").permitAll()
.simpSubscribeDestMatchers("/topic/**").permitAll()
.anyMessage().authenticated()
;
}
@Override
protected boolean sameOriginDisabled() {
//disable CSRF for …
Run Code Online (Sandbox Code Playgroud)